<?php
defined('IN_MYBB') or die('Direct initialization of this file is not allowed.');
if(defined('IN_ADMINCP'))
{
$plugins->add_hook('admin_config_settings_start', array('OUGC_ShowInPortal', 'lang_load'));
$plugins->add_hook('admin_style_templates_set', array('OUGC_ShowInPortal', 'lang_load'));
$plugins->add_hook('admin_config_settings_change', array('OUGC_ShowInPortal', 'lang_load'));
$plugins->add_hook('admin_formcontainer_end', 'ougc_showinportal_modtools');
$plugins->add_hook('admin_config_mod_tools_add_thread_tool_commit', 'ougc_showinportal_modtools_commit');
$plugins->add_hook('admin_config_mod_tools_edit_thread_tool_commit', 'ougc_showinportal_modtools_commit');
}
else
{
global $settings;
$plugins->add_hook('moderation_start', 'ougc_showinportal_moderation');
$plugins->add_hook('newthread_end', 'ougc_showinportal_newthread_end');
$plugins->add_hook('datahandler_post_insert_thread', 'ougc_showinportal_insert_thread');
$plugins->add_hook('showthread_end', 'ougc_showinportal_showthread_end');
$plugins->add_hook('datahandler_post_insert_post', 'ougc_showinportal_post_insert_post');
$plugins->add_hook('newreply_end', 'ougc_showinportal_newthread_end');
$plugins->add_hook('postbit', 'ougc_showinportal_postbit');
$plugins->add_hook('portal_start', 'ougc_showinportal_portal');
$plugins->add_hook('xmlhttp_update_post', 'ougc_showinportal_xmlhttp');
$plugins->add_hook('myalerts_load_lang', array('OUGC_ShowInPortal', 'lang_load'));
$plugins->add_hook('misc_help_helpdoc_start', 'ougc_showinportal_myalerts_helpdoc');
$plugins->add_hook('myalerts_alerts_output_end', 'ougc_showinportal_myalerts_output');
if(in_array(THIS_SCRIPT, array('forumdisplay.php', 'showthread.php', 'newthread.php', 'newreply.php')))
{
global $templatelist;
if(!isset($templatelist))
{
$templatelist = '';
}
else
{
$templatelist .= ',';
}
$templatelist .= 'ougcshowinportal_input';
}
}
defined('PLUGINLIBRARY') or define('PLUGINLIBRARY', MYBB_ROOT.'inc/plugins/pluginlibrary.php');
function ougc_showinportal_info()
{
global $lang, $showinportal;
$showinportal->lang_load();
return array(
'name' => 'OUGC Show in Portal',
'description' => $lang->setting_group_ougc_showinportal_desc,
'website' => 'http://omarg.me',
'author' => 'Omar G.',
'authorsite' => 'http://omarg.me',
'version' => '1.8',
'versioncode' => 1800,
'compatibility' => '18*',
'myalerts' => 105,
'pl' => array(
'version' => 12,
'url' => 'http://mods.mybb.com/view/pluginlibrary'
)
);
}
function ougc_showinportal_activate()
{
global $PL, $lang, $cache, $showinportal;
$showinportal->lang_load();
ougc_showinportal_deactivate();
$PL->settings('ougc_showinportal', $lang->setting_group_ougc_showinportal, $lang->setting_group_ougc_showinportal_desc, array(
'groups' => array(
'title' => $lang->setting_ougc_showinportal_groups,
'description' => $lang->setting_ougc_showinportal_groups_desc,
'optionscode' => 'groupselect',
'value' => '3,4,6',
),
'forums' => array(
'title' => $lang->setting_ougc_showinportal_forums,
'description' => $lang->setting_ougc_showinportal_forums_desc,
'optionscode' => 'forumselect',
'value' => '',
),
'tag' => array(
'title' => $lang->setting_ougc_showinportal_tag,
'description' => $lang->setting_ougc_showinportal_tag_desc,
'optionscode' => 'text',
'value' => '[!--more--]',
),
'myalerts' => array(
'title' => $lang->setting_ougc_showinportal_myalerts,
'description' => $lang->setting_ougc_showinportal_myalerts_desc,
'optionscode' => 'yesno',
'value' => 0,
)
));
$PL->templates('ougcshowinportal', '<lang:setting_group_ougc_showinportal>', array(
'input' => '<br /><label><input type="checkbox" class="checkbox" name="{$name}" value="1"{$checked} /> {$message}</label>'
));
require_once MYBB_ROOT.'inc/adminfunctions_templates.php';
find_replace_templatesets('newreply_modoptions', '#'.preg_quote('stick_thread}</label>').'#', 'stick_thread}</label><!--OUGC_SHOWINPORTAL-->');
find_replace_templatesets('showthread_quickreply', '#'.preg_quote('{$closeoption}').'#', '{$closeoption}<!--OUGC_SHOWINPORTAL-->');
$plugins = $cache->read('ougc_plugins');
if(!$plugins)
{
$plugins = array();
}
$info = ougc_showinportal_info();
if(!isset($plugins['showinportal']))
{
$plugins['showinportal'] = $info['versioncode'];
}
if($plugins['showinportal'] <= 1200)
{
ougc_showinportal_install();
}
$plugins['showinportal'] = $info['versioncode'];
$cache->update('ougc_plugins', $plugins);
}
function ougc_showinportal_deactivate($rebuilt=true)
{
ougc_showinportal_pl_check();
require_once MYBB_ROOT.'inc/adminfunctions_templates.php';
find_replace_templatesets('newreply_modoptions', '#'.preg_quote('<!--OUGC_SHOWINPORTAL-->').'#', '', 0);
find_replace_templatesets('showthread_quickreply', '#'.preg_quote('<!--OUGC_SHOWINPORTAL-->').'#', '', 0);
find_replace_templatesets('forumdisplay_inlinemoderation', '#'.preg_quote('<!--OUGC_SHOWINPORTAL-->').'#', '', 0);
find_replace_templatesets('showthread_moderationoptions', '#'.preg_quote('<!--OUGC_SHOWINPORTAL-->').'#', '', 0);
}
function ougc_showinportal_install()
{
global $db;
if(!$db->field_exists('showinportal', 'threads'))
{
$db->add_column('threads', 'showinportal', 'int(1) NOT NULL DEFAULT \'0\'');
}
if($db->table_exists('alert_settings') && $db->table_exists('alert_setting_values'))
{
$query = $db->simple_select('alert_settings', 'id', 'code=\'ougc_showinportal\'');
if(!($id = (int)$db->fetch_field($query, 'id')))
{
$id = (int)$db->insert_query('alert_settings', array('code' => 'ougc_showinportal'));
$db->delete_query('alert_setting_values', 'setting_id=\''.$id.'\'');
$query = $db->simple_select('users', 'uid');
while($uid = (int)$db->fetch_field($query, 'uid'))
{
$settings[] = array(
'user_id' => $uid,
'setting_id' => $id,
'value' => 1
);
}
if(!empty($settings))
{
$db->insert_query_multiple('alert_setting_values', $settings);
}
}
}
}
function ougc_showinportal_is_installed()
{
global $db;
return $db->field_exists('showinportal', 'threads');
}
function ougc_showinportal_uninstall()
{
global $db, $PL, $cache;
ougc_showinportal_pl_check();
if($db->field_exists('showinportal', 'threads'))
{
$db->drop_column('threads', 'showinportal');
}
if($db->table_exists('alert_settings'))
{
$db->delete_query('alert_settings', 'code=\'ougc_showinportal\'');
}
$PL->settings_delete('ougc_showinportal');
$PL->templates_delete('ougcshowinportal');
$plugins = (array)$cache->read('ougc_plugins');
if(isset($plugins['showinportal']))
{
unset($plugins['showinportal']);
}
if(!empty($plugins))
{
$cache->update('ougc_plugins', $plugins);
}
else
{
$PL->cache_delete('ougc_plugins');
}
}
function ougc_showinportal_pl_check()
{
global $lang, $showinportal;
$showinportal->lang_load();
$info = ougc_showinportal_info();
if(!file_exists(PLUGINLIBRARY))
{
flash_message($lang->sprintf($lang->ougc_showinportal_pl_required, $info['pl']['url'], $info['pl']['version']), 'error');
admin_redirect('index.php?module=config-plugins');
exit;
}
global $PL;
$PL or require_once PLUGINLIBRARY;
if($PL->version < $info['pl']['version'])
{
flash_message($lang->sprintf($lang->ougc_showinportal_pl_old, $info['pl']['url'], $info['pl']['version'], $PL->version), 'error');
admin_redirect('index.php?module=config-plugins');
exit;
}
}
function ougc_showinportal_modtools()
{
global $mybb, $run_module, $form_container, $lang;
if(!($run_module == 'config' && !empty($form_container->_title) && !empty($lang->thread_moderation) && $form_container->_title == $lang->thread_moderation && $mybb->get_input('action') != 'add_post_tool' && $mybb->get_input('action') != 'edit_post_tool'))
{
return;
}
global $form, $showinportal;
$showinportal->lang_load();
if($mybb->get_input('action') != 'add_thread_tool' && !isset($mybb->input['showinportal']))
{
global $thread_options;
$mybb->input['showinportal'] = (int)$thread_options['showinportal'];
}
$sip = $mybb->get_input('showinportal', 1);
$sip = ($sip > 3 || $sip < 0 ? 0 : (int)$sip);
$form_container->output_row($lang->ougc_showinportal_modtool.' <em>*</em>', '', $form->generate_select_box('showinportal', array(
0 => $lang->no_change,
1 => $lang->ougc_showinportal_modtool_show,
2 => $lang->ougc_showinportal_modtool_remove,
3 => $lang->toggle
), $sip, array('id' => 'showinportal')), 'showinportal');
}
function ougc_showinportal_modtools_commit()
{
global $mybb;
if($mybb->request_method == 'post')
{
global $db, $thread_options, $update_tool, $new_tool;
$sip = $mybb->get_input('showinportal', 1);
$thread_options['showinportal'] = ($sip > 3 || $sip < 0 ? 0 : $sip);
$var = $mybb->get_input('action') == 'add_thread_tool' ? 'new_tool' : 'update_tool';
${$var}['threadoptions'] = $db->escape_string(serialize($thread_options));
if($mybb->get_input('action') == 'add_thread_tool')
{
global $tid;
$db->update_query('modtools', $new_tool, 'tid=\''.$tid.'\'');
}
}
}
function ougc_showinportal_moderation()
{
global $mybb;
global $mybb;
if(!in_array($mybb->get_input('action'), array('showinportal', 'multishowinportal', 'multiunshowinportal')))
{
if(in_array($mybb->get_input('action'), array('reports', 'allreports', 'getip', 'cancel_delayedmoderation', 'delayedmoderation', 'do_delayedmoderation', 'openclosethread', 'stick', 'removeredirects', 'deletethread', 'do_deletethread', 'deletepoll', 'do_deletepoll', 'approvethread', 'unapprovethread', 'deleteposts', 'do_deleteposts', 'mergeposts', 'do_mergeposts', 'move', 'do_move', 'threadnotes', 'do_threadnotes', 'merge', 'do_merge', 'split', 'do_split', 'removesubscriptions', 'multideletethreads', 'do_multideletethreads', 'multiopenthreads', 'multiclosethreads', 'multiapprovethreads', 'multiunapprovethreads', 'multistickthreads', 'multiunstickthreads', 'multimovethreads', 'do_multimovethreads', 'multideleteposts', 'do_multideleteposts', 'multimergeposts', 'do_multimergeposts', 'multisplitposts', 'do_multisplitposts', 'multiapproveposts', 'multiunapproveposts')) || ($tid = $mybb->get_input('action', 1)) < 1)
{
return;
}
control_object($GLOBALS['db'], '
function simple_select($table, $fields="*", $conditions="", $options=array())
{
static $done=false;
if(!$done && $table == "modtools" && substr($conditions, 0, 4) == "tid=" && empty($options))
{
$done = true;
ougc_showinportal_moderation_custom();
}
return parent::simple_select($table, $fields, $conditions, $options);
}
');
return;
}
}
function ougc_showinportal_moderation_custom()
{
global $custommod;
if(!is_object($custommod))
{
return;
}
control_object($custommod, '
function execute_thread_moderation($thread_options, $tids)
{
if(!$thread_options[\'deletethread\'])
{
ougc_showinportal_moderation_custom_do($tids, $thread_options[\'showinportal\']);
}
return parent::execute_thread_moderation($thread_options, $tids);
}
');
}
function ougc_showinportal_moderation_custom_do($tids, $sip)
{
$sip = ($sip > 3 || $sip < 0 ? 0 : $sip);
if(!$sip)
{
return;
}
global $showinportal;
switch($sip)
{
case 1:
case 2:
$showinportal->thread_update($sip, $tids);
break;
case 3:
global $db;
$query = $db->simple_select('threads', 'tid, showinportal', 'tid IN (\''.implode('\',\'', $tids).'\')');
while($thread = $db->fetch_array($query))
{
if($thread['showinportal'])
{
$remove[] = (int)$thread['tid'];
}
else
{
$show[] = (int)$thread['tid'];
}
}
empty($remove) or $showinportal->thread_update(0, $remove);
empty($show) or $showinportal->thread_update(1, $show);
break;
}
}
function ougc_showinportal_newthread_end()
{
global $modoptions;
if(!isset($modoptions) || my_strpos($modoptions, '<!--OUGC_SHOWINPORTAL-->') === false)
{
return;
}
global $showinportal, $mybb, $fid;
if(!$showinportal->can_moderate($fid))
{
return;
}
global $templates, $lang, $thread;
$showinportal->lang_load();
if(THIS_SCRIPT == 'newreply.php' && !isset($mybb->input['modoptions']) && !isset($mybb->input['modoptions']['showinportal']) && isset($thread['showinportal']))
{
$mybb->input['modoptions']['showinportal'] = (int)$thread['showinportal'];
}
$sip = (int)$mybb->input['modoptions']['showinportal'];
$checked = '';
if(!empty($sip))
{
$checked = ' checked="checked"';
}
$name = 'modoptions[showinportal]';
$message = $lang->ougc_showinportal_input_newthread;
eval('$ougc_showinportal = "'.$templates->get('ougcshowinportal_input').'";');
$modoptions = str_replace('<!--OUGC_SHOWINPORTAL-->', $ougc_showinportal, $modoptions);
}
function ougc_showinportal_insert_thread(&$dh)
{
global $settings;
$dh->thread_insert_data['showinportal'] = 0;
if(is_moderator($dh->data['fid']))
{
global $showinportal;
if($showinportal->can_moderate($dh->data['fid']) && !empty($dh->data['modoptions']['showinportal']))
{
$dh->thread_insert_data['showinportal'] = 1;
}
}
}
function ougc_showinportal_showthread_end()
{
global $showinportal, $settings, $thread;
if(!$showinportal->can_moderate($thread['fid']))
{
return;
}
global $templates, $lang, $quickreply, $moderationoptions;
$showinportal->lang_load();
$checked = '';
if($thread['showinportal'])
{
$checked = ' checked="checked"';
}
$name = 'modoptions[showinportal]';
$message = $lang->ougc_showinportal_input_quickreply;
eval('$ougc_showinportal = "'.$templates->get('ougcshowinportal_input').'";');
$quickreply = str_replace('<!--OUGC_SHOWINPORTAL-->', $ougc_showinportal, $quickreply);
}
function ougc_showinportal_post_insert_post(&$args)
{
global $showinportal;
$thread = get_thread($args->data['tid']);
if($thread['showinportal'] && !$args->data['modoptions']['showinportal'])
{
$showinportal->thread_update(0, $thread['tid']);
}
if(!$thread['showinportal'] && $args->data['modoptions']['showinportal'])
{
$showinportal->thread_update(1, $thread['tid']);
}
}
function ougc_showinportal_postbit(&$post)
{
global $thread, $plugins;
$plugins->remove_hook('postbit', 'ougc_showinportal_postbit');
if($thread['firstpost'] != $post['pid'] || !$thread['showinportal'])
{
return;
}
global $showinportal, $settings;
if(!$showinportal->can_moderate($thread['fid']))
{
return;
}
$post['message'] = preg_replace('#'.preg_quote($settings['ougc_showinportal_tag']).'#', '', $post['message']);
}
function ougc_showinportal_xmlhttp()
{
global $post;
ougc_showinportal_postbit($post);
}
function ougc_showinportal_portal()
{
global $db, $settings;
control_object($db, '
function query($string, $hide_errors=0, $write_query=0)
{
if(!$write_query && strpos($string, \'ORDER BY t.dateline DESC\'))
{
$string = strtr($string, array(
\'t.closed\' => \'t.showinportal=\\\'1\\\' AND t.closed\'
));
}
if(!$write_query && strpos($string, \'OUNT(t.tid) AS thread\'))
{
$string = strtr($string, array(
\'t.visible\' => \'t.showinportal=\\\'1\\\' AND t.visible\'
));
}
return parent::query($string, $hide_errors, $write_query);
}
');
if(!empty($settings['ougc_showinportal_tag']))
{
global $plugins;
$plugins->add_hook('portal_announcement', create_function('', 'global $announcement; ougc_showinportal_cutoff($announcement[\'message\'], $announcement[\'fid\'], $announcement[\'tid\']);'));
}
}
function ougc_showinportal_cutoff(&$message, $fid, $tid)
{
global $settings;
if(!$message || !$settings['ougc_showinportal_tag'])
{
return;
}
if(!preg_match('#'.($tag = preg_quote($settings['ougc_showinportal_tag'])).'#', $message))
{
return;
}
$msg = preg_split('#'.$tag.'#', $message);
if(!(isset($msg[0]) && my_strlen($msg[0]) >= (int)$settings['minmessagelength']))
{
return;
}
global $lang, $forum_cache, $showinportal;
$showinportal->lang_load();
$forum_cache or cache_forums();
$lang_var = 'ougc_showinportal_readmore';
if((bool)$forum_cache[$fid]['allowmycode'])
{
$lang_var .= '_mycode';
}
elseif((bool)$forum_cache[$fid]['allowhtml'])
{
$lang_var .= '_html';
}
$message = $msg[0].$lang->sprintf($lang->{$lang_var}, $settings['bburl'], get_thread_link($tid));
}
if(!function_exists('control_object'))
{
function control_object(&$obj, $code)
{
static $cnt = 0;
$newname = '_objcont_'.(++$cnt);
$objserial = serialize($obj);
$classname = get_class($obj);
$checkstr = 'O:'.strlen($classname).':"'.$classname.'":';
$checkstr_len = strlen($checkstr);
if(substr($objserial, 0, $checkstr_len) == $checkstr)
{
$vars = array();
foreach((array)$obj as $k => $v)
{
if($p = strrpos($k, "\0"))
{
$k = substr($k, $p+1);
}
$vars[$k] = $v;
}
if(!empty($vars))
{
$code .= '
function ___setvars(&$a) {
foreach($a as $k => &$v)
$this->$k = $v;
}
';
}
eval('class '.$newname.' extends '.$classname.' {'.$code.'}');
$obj = unserialize('O:'.strlen($newname).':"'.$newname.'":'.substr($objserial, $checkstr_len));
if(!empty($vars))
{
$obj->___setvars($vars);
}
}
}
}
function ougc_showinportal_myalerts_helpdoc()
{
global $helpdoc, $lang, $settings;
if($helpdoc['name'] != $lang->myalerts_help_alert_types)
{
return;
}
if($settings['ougc_showinportal_myalerts'])
{
global $showinportal;
$showinportal->lang_load();
$helpdoc['document'] .= $lang->ougc_showinportal_myalerts_helpdoc;
}
}
function ougc_showinportal_myalerts_output(&$args)
{
global $mybb;
if($args['alert_type'] != 'ougc_showinportal' || !$mybb->user['myalerts_settings']['ougc_showinportal'])
{
return;
}
global $showinportal, $lang;
$showinportal->lang_load();
$lang_var = 'ougc_showinportal_myalerts_showinportal';
if(!$args['content'][0])
{
$lang_var = 'ougc_showinportal_myalerts_unshowinportal';
}
$thread = get_thread($args['tid']);
if(!$thread)
{
return;
}
$args['threadLink'] = $mybb->settings['bburl'].'/'.get_thread_link($thread['tid']);
$args['message'] = $lang->sprintf($lang->{$lang_var}, $args['user'], $args['threadLink'], htmlspecialchars_uni($thread['subject']), $args['dateline']);
$args['rowType'] = 'showinportal';
}
class OUGC_ShowInPortal
{
function __construct()
{
global $settings;
if($settings['ougc_showinportal_myalerts'])
{
$settings['myalerts_alert_ougc_showinportal'] = 1;
}
}
function lang_load()
{
global $lang;
isset($lang->setting_group_ougc_showinportal) or $lang->load('ougc_showinportal');
if(isset($lang->ougc_showinportal_myalerts_setting))
{
$lang->myalerts_setting_ougc_showinportal = $lang->ougc_showinportal_myalerts_setting;
}
}
function is_member($gids, $usergroup=false)
{
global $PL;
$PL or require_once PLUGINLIBRARY;
if($usergroup !== false)
{
$usergroup = array('usergroup' => (int)$usergroup);
}
return (bool)$PL->is_member($gids, $usergroup);
}
function can_moderate($fid)
{
if(!is_moderator($fid))
{
return false;
}
global $settings;
if(($settings['portal_announcementsfid'] != -1 && !$this->is_member($settings['portal_announcementsfid'], $fid)) && !$settings['portal_announcementsfid'])
{
return false;
}
if($this->is_member($settings['ougc_showinportal_forums'], $fid))
{
return false;
}
if(($settings['ougc_showinportal_groups'] != -1 && !$this->is_member($settings['ougc_showinportal_groups'])) || !$settings['ougc_showinportal_groups'])
{
return false;
}
return true;
}
function thread_update($sip, $tids)
{
if(!is_array($tids))
{
$tids = array($tids);
}
global $db, $lang;
$this->lang_load();
$sip = (int)(bool)$sip;
$where = implode('\',\'', array_filter(array_map('intval', $tids)));
$db->update_query('threads', array('showinportal' => $sip), 'tid IN (\''.$where.'\')');
$lang_var = 'ougc_showinportal_pm_subject'.($sip ? '' : '_removed');
$lang_var_message = 'ougc_showinportal_pm_message'.($sip ? '' : '_removed');
$this->send_pm(array(
'subject' => $lang->{$lang_var},
'message' => $lang->{$lang_var_message},
'touid' => $uid
), -1, true, $tids);
$this->my_alerts($sip, $tids);
return true;
}
function send_pm($pm, $fromid=0, $admin_override=false, $tids)
{
global $mybb;
if(!$mybb->settings['enablepms'])
{
return false;
}
if(!is_array($pm))
{
return false;
}
if(!$pm['subject'] ||!$pm['message'] || (!$pm['receivepms'] && !$admin_override))
{
return false;
}
global $lang, $db, $session;
$lang->load('messages');
require_once MYBB_ROOT."inc/datahandlers/pm.php";
$pmhandler = new PMDataHandler();
$pm['touid'] = array();
$query = $db->simple_select('threads', 'uid', 'uid!=\'0\' AND uid!=\''.(int)$mybb->user['uid'].'\' AND tid IN (\''.implode('\',\'', array_filter(array_map('intval', $tids))).'\')');
while($uid = (int)$db->fetch_field($query, 'uid'))
{
$pm['touid'][$uid] = $uid;
}
if(!$pm['touid'])
{
return;
}
$pm = array(
'subject' => $pm['subject'],
'message' => $lang->sprintf($pm['message'], $mybb->settings['bbname']),
'icon' => -1,
'fromid' => ($fromid == 0 ? (int)$mybb->user['uid'] : ($fromid < 0 ? 0 : $fromid)),
'toid' => $pm['touid'],
'bccid' => array(),
'do' => '',
'pmid' => '',
'saveasdraft' => 0,
'options' => array(
'signature' => 0,
'disablesmilies' => 0,
'savecopy' => 0,
'readreceipt' => 0
)
);
if(isset($mybb->session))
{
$pm['ipaddress'] = $mybb->session->packedip;
}
$pmhandler->admin_override = (int)$admin_override;
$pmhandler->set_data($pm);
if($pmhandler->validate_pm())
{
$pmhandler->insert_pm();
return true;
}
return false;
}
function my_alerts($sip, $tids)
{
global $mybb;
if(!$mybb->settings['ougc_showinportal_myalerts'])
{
return;
}
$plugins = (array)$mybb->cache->read('euantor_plugins');
if(empty($plugins['myalerts']))
{
return;
}
$info = ougc_showinportal_info();
if(str_replace('.', '', $plugins['myalerts']['version']) < $info['myalerts'])
{
return;
}
global $Alerts;
if(!(!empty($Alerts) && $Alerts instanceof Alerts))
{
return;
}
global $db;
$query = $db->simple_select('threads', 'uid, tid', 'uid!=\'0\' AND uid!=\''.(int)$mybb->user['uid'].'\' AND tid IN (\''.implode('\',\'', array_filter(array_map('intval', $tids))).'\')');
while($thread = $db->fetch_array($query))
{
$Alerts->addAlert($thread['uid'], 'ougc_showinportal', $thread['tid'], $mybb->user['uid'], array($sip));
}
}
}
$GLOBALS['showinportal'] = new OUGC_ShowInPortal;
|