Skip to content

Commit

Permalink
Prepping v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Eldenroot authored Jan 30, 2017
1 parent b47afbc commit e3026bd
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions inc/plugins/thankyoulike.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function thankyoulike_info()
"website" => "https://community.mybb.com/thread-169382.html",
"author" => "- G33K -",
"authorsite" => "https://community.mybb.com/user-19236.html",
"version" => "1.9.11",
"version" => "2.0.0",
"codename" => "thankyoulikesystem",
"compatibility" => "18*"
);
Expand Down Expand Up @@ -137,9 +137,9 @@ function thankyoulike_admin_load()
function tyl_myalerts_integrate()
{
global $db, $cache;
// Verify if myalerts exists and if compatible with 1.8.x then add alert type
// Verify if MyAlerts exists and if is compatible with 1.8.x then add alert type
if(function_exists("myalerts_info")){
// Load myalerts info into an array
// Load MyAlerts info into an array
$my_alerts_info = myalerts_info();
// Set version info to a new var
$verify = $my_alerts_info['version'];
Expand All @@ -148,15 +148,15 @@ function tyl_myalerts_integrate()
// Load cache data and compare if version is the same or not
$myalerts_plugins = $cache->read('mybbstuff_myalerts_alert_types');
if($myalerts_plugins['tyl']['code'] != 'tyl'){
//Adding alert type to db
// Adding alert type into db
$alertTypeManager = MybbStuff_MyAlerts_AlertTypeManager::createInstance($db, $cache);
$alertType = new MybbStuff_MyAlerts_Entity_AlertType();
$alertType->setCode('tyl');
$alertType->setEnabled(true);
$alertTypeManager->add($alertType);
}

flash_message("MyAlerts and TYL System were integrated successfully!", 'success');
flash_message("MyAlerts and Thank You/Like System were integrated successfully!", 'success');
admin_redirect('index.php?module=config-plugins');
}
}
Expand Down Expand Up @@ -267,7 +267,7 @@ function thankyoulike_install()
}


// Insert settings in to the database
// Insert settings into the database
$query = $db->query("SELECT disporder FROM ".TABLE_PREFIX."settinggroups ORDER BY `disporder` DESC LIMIT 1");
$disporder = $db->fetch_field($query, 'disporder')+1;

Expand Down Expand Up @@ -464,7 +464,7 @@ function thankyoulike_install()
$db->insert_query('templates', $insert_templates);
}

// css-class for g33k_thankyoulike
// css-class for thankyoulike
$css = array(
"name" => "thankyoulike.css",
"tid" => 1,
Expand Down Expand Up @@ -568,18 +568,18 @@ function thankyoulike_activate()
find_replace_templatesets("member_profile", '#{\$reputation}(\r?)\n#', "{\$tyl_memprofile}\n{\$reputation}\n");
}

// Verify if myalerts exists and if it is compatible with 1.8.x, then add alert type
// Verify if MyAlerts exists and if it is compatible with 1.8.x, then add alert type
if(function_exists("myalerts_info")){
// Load myalerts info into an array
// Load MyAlerts info into an array
$my_alerts_info = myalerts_info();
// Set version info to a new var
$verify = $my_alerts_info['version'];
// If MyAlerts 2.0 or better then do this !!!
// If MyAlerts 2.0 or better then do this!!!
if($verify >= "2.0.0"){
// Load cache data and compare if version is the same or not
$myalerts_plugins = $cache->read('mybbstuff_myalerts_alert_types');
if($myalerts_plugins['tyl']['code'] != 'tyl'){
//Adding alert type to db
// Adding alert type into database
$alertTypeManager = MybbStuff_MyAlerts_AlertTypeManager::createInstance($db, $cache);
$alertType = new MybbStuff_MyAlerts_Entity_AlertType();
$alertType->setCode('tyl');
Expand Down Expand Up @@ -619,7 +619,7 @@ function thankyoulike_deactivate()
find_replace_templatesets("member_profile", '#{\$tyl_memprofile}(\r?)\n#', "", 0);

if(function_exists("myalerts_info")){
// Load myalerts info into an array
// Load MyAlerts info into an array
$my_alerts_info = myalerts_info();
// Set version info to a new var
$verify = $my_alerts_info['version'];
Expand Down Expand Up @@ -851,7 +851,7 @@ function thankyoulike_postbit(&$post)
}
}

// Setup the stat in postbit
// Setup stats in postbit
if ($mybb->settings[$prefix.'thankslike'] == "like")
{
$lang->tyl_rcvd = $lang->tyl_likes_rcvd;
Expand Down Expand Up @@ -879,7 +879,7 @@ function thankyoulike_postbit(&$post)
return $post;
}

// Get all the ty/l data for all the posts on this thread
// Get all the thank you/like data for all the posts on this thread
// Check first is it already fetched/cached?
if(!is_array($g33k_pcache))
{
Expand Down Expand Up @@ -1147,7 +1147,7 @@ function thankyoulike_postbit_udetails(&$post)
return $post;
}

// Sending the alert to db
// Sending the alert to database
function tyl_recordAlertThankyou()
{
global $db, $lang, $mybb, $alert, $post, $prefix;
Expand All @@ -1168,7 +1168,7 @@ function tyl_recordAlertThankyou()
$alertType = MybbStuff_MyAlerts_AlertTypeManager::getInstance()->getByCode('tyl');

if(isset($alertType) && $alertType->getEnabled()){
//check if already alerted
// Check if already alerted
$query = $db->simple_select(
'alerts',
'id',
Expand All @@ -1189,7 +1189,7 @@ function tyl_recordAlertThankyou()
}
}

// Alert formatter for my custom alerts.
// Alert formatter for my custom alerts
function tyl_myalerts_formatter_load(){
global $mybb, $prefix;
$prefix = 'g33k_thankyoulike_';
Expand Down

0 comments on commit e3026bd

Please sign in to comment.