"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/showthread.php" between
mybb_1819.zip and mybb_1820.zip

About: MyBB is a multilingual, standards-compliant and free forum (discussion board) software.

showthread.php  (mybb_1819):showthread.php  (mybb_1820)
skipping to change at line 16 skipping to change at line 16
* Website: http://www.mybb.com * Website: http://www.mybb.com
* License: http://www.mybb.com/about/license * License: http://www.mybb.com/about/license
* *
*/ */
define("IN_MYBB", 1); define("IN_MYBB", 1);
define('THIS_SCRIPT', 'showthread.php'); define('THIS_SCRIPT', 'showthread.php');
$templatelist = "showthread,postbit,postbit_author_user,postbit_author_guest,sho wthread_newthread,showthread_newreply,showthread_newreply_closed,postbit_avatar, postbit_find,postbit_pm,postbit_www,postbit_email,postbit_edit,postbit_quote,pos tbit_report"; $templatelist = "showthread,postbit,postbit_author_user,postbit_author_guest,sho wthread_newthread,showthread_newreply,showthread_newreply_closed,postbit_avatar, postbit_find,postbit_pm,postbit_www,postbit_email,postbit_edit,postbit_quote,pos tbit_report";
$templatelist .= ",multipage,multipage_breadcrumb,multipage_end,multipage_jump_p age,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link _current,multipage_prevpage,multipage_start,showthread_inlinemoderation_softdele te,showthread_poll_editpoll"; $templatelist .= ",multipage,multipage_breadcrumb,multipage_end,multipage_jump_p age,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link _current,multipage_prevpage,multipage_start,showthread_inlinemoderation_softdele te,showthread_poll_editpoll";
$templatelist .= ",postbit_editedby,showthread_similarthreads,showthread_similar threads_bit,postbit_iplogged_show,postbit_iplogged_hiden,postbit_profilefield,sh owthread_quickreply,showthread_add_poll,showthread_send_thread,showthread_inline moderation_restore"; $templatelist .= ",postbit_editedby,showthread_similarthreads,showthread_similar threads_bit,postbit_iplogged_show,postbit_iplogged_hiden,postbit_profilefield,sh owthread_quickreply,showthread_printthread,showthread_add_poll,showthread_send_t hread,showthread_inlinemoderation_restore";
$templatelist .= ",forumjump_advanced,forumjump_special,forumjump_bit,postbit_at tachments,postbit_attachments_attachment,postbit_attachments_thumbnails,postbit_ attachments_images_image,postbit_attachments_images,showthread_quickreply_option s_stick,postbit_status"; $templatelist .= ",forumjump_advanced,forumjump_special,forumjump_bit,postbit_at tachments,postbit_attachments_attachment,postbit_attachments_thumbnails,postbit_ attachments_images_image,postbit_attachments_images,showthread_quickreply_option s_stick,postbit_status";
$templatelist .= ",postbit_inlinecheck,showthread_inlinemoderation,postbit_attac hments_thumbnails_thumbnail,postbit_ignored,postbit_multiquote,showthread_modera tionoptions_custom_tool,showthread_moderationoptions_custom,showthread_inlinemod eration_custom_tool"; $templatelist .= ",postbit_inlinecheck,showthread_inlinemoderation,postbit_attac hments_thumbnails_thumbnail,postbit_ignored,postbit_multiquote,showthread_modera tionoptions_custom_tool,showthread_moderationoptions_custom,showthread_inlinemod eration_custom_tool";
$templatelist .= ",showthread_usersbrowsing,showthread_usersbrowsing_user,showth read_poll_option,showthread_poll,showthread_quickreply_options_signature,showthr ead_threaded_bitactive,showthread_threaded_bit,postbit_attachments_attachment_un approved"; $templatelist .= ",showthread_usersbrowsing,showthread_usersbrowsing_user,showth read_poll_option,showthread_poll,showthread_quickreply_options_signature,showthr ead_threaded_bitactive,showthread_threaded_bit,postbit_attachments_attachment_un approved";
$templatelist .= ",showthread_moderationoptions_openclose,showthread_moderationo ptions_stickunstick,showthread_moderationoptions_delete,showthread_moderationopt ions_threadnotes,showthread_moderationoptions_manage,showthread_moderationoption s_deletepoll"; $templatelist .= ",showthread_moderationoptions_openclose,showthread_moderationo ptions_stickunstick,showthread_moderationoptions_delete,showthread_moderationopt ions_threadnotes,showthread_moderationoptions_manage,showthread_moderationoption s_deletepoll";
$templatelist .= ",postbit_userstar,postbit_reputation_formatted_link,postbit_wa rninglevel_formatted,postbit_quickrestore,forumdisplay_password,forumdisplay_pas sword_wrongpass,postbit_purgespammer,showthread_inlinemoderation_approve,forumdi splay_thread_icon"; $templatelist .= ",postbit_userstar,postbit_reputation_formatted_link,postbit_wa rninglevel_formatted,postbit_quickrestore,forumdisplay_password,forumdisplay_pas sword_wrongpass,postbit_purgespammer,showthread_inlinemoderation_approve,forumdi splay_thread_icon";
$templatelist .= ",showthread_moderationoptions_softdelete,showthread_moderation options_restore,post_captcha,post_captcha_recaptcha_invisible,post_captcha_nocap tcha,showthread_moderationoptions,showthread_inlinemoderation_standard,showthrea d_inlinemoderation_manage"; $templatelist .= ",showthread_moderationoptions_softdelete,showthread_moderation options_restore,post_captcha,post_captcha_recaptcha_invisible,post_captcha_nocap tcha,showthread_moderationoptions,showthread_inlinemoderation_standard,showthrea d_inlinemoderation_manage";
$templatelist .= ",showthread_ratethread,postbit_posturl,postbit_icon,postbit_ed itedby_editreason,attachment_icon,global_moderation_notice,showthread_poll_optio n_multiple,postbit_gotopost,postbit_rep_button,postbit_warninglevel,showthread_t hreadnoteslink"; $templatelist .= ",showthread_ratethread,postbit_posturl,postbit_icon,postbit_ed itedby_editreason,attachment_icon,global_moderation_notice,showthread_poll_optio n_multiple,postbit_gotopost,postbit_rep_button,postbit_warninglevel,showthread_t hreadnoteslink";
$templatelist .= ",showthread_moderationoptions_approve,showthread_moderationopt ions_unapprove,showthread_inlinemoderation_delete,showthread_moderationoptions_s tandard,showthread_quickreply_options_close,showthread_inlinemoderation_custom,s howthread_search"; $templatelist .= ",showthread_moderationoptions_approve,showthread_moderationopt ions_unapprove,showthread_inlinemoderation_delete,showthread_moderationoptions_s tandard,showthread_quickreply_options_close,showthread_inlinemoderation_custom,s howthread_search";
$templatelist .= ",postbit_profilefield_multiselect_value,postbit_profilefield_m ultiselect,showthread_subscription,postbit_deleted_member,postbit_away,postbit_w arn,postbit_classic,postbit_reputation,postbit_deleted,postbit_offline,postbit_o nline,postbit_signature"; $templatelist .= ",postbit_profilefield_multiselect_value,postbit_profilefield_m ultiselect,showthread_subscription,postbit_deleted_member,postbit_away,postbit_w arn,postbit_classic,postbit_reputation,postbit_deleted,postbit_offline,postbit_o nline,postbit_signature";
$templatelist .= ",postbit_editreason,postbit_quickdelete,showthread_threadnotes _viewnotes,showthread_threadedbox,showthread_poll_resultbit,showthread_poll_resu lts,showthread_threadnotes,showthread_classic_header,showthread_poll_undovote,po stbit_groupimage"; $templatelist .= ",postbit_editreason,postbit_quickdelete,showthread_threadnotes _viewnotes,showthread_threadedbox,showthread_poll_resultbit,showthread_poll_resu lts,showthread_threadnotes,showthread_classic_header,showthread_poll_undovote,po stbit_groupimage";
skipping to change at line 148 skipping to change at line 148
} }
} }
else else
{ {
$ismod = false; $ismod = false;
} }
// Make sure we are looking at a real thread here. // Make sure we are looking at a real thread here.
if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] == 0 && ! is_moderator($fid, "canviewunapprove")) || ($thread['visible'] == -1 && !is_mode rator($fid, "canviewdeleted"))) if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] == 0 && ! is_moderator($fid, "canviewunapprove")) || ($thread['visible'] == -1 && !is_mode rator($fid, "canviewdeleted")))
{ {
error($lang->error_invalidthread); // Allow viewing own unapproved thread
if (!($mybb->user['uid'] && $mybb->settings['showownunapproved'] && $thre
ad['visible'] == 0 && ($thread['uid'] == $mybb->user['uid'])))
{
error($lang->error_invalidthread);
}
} }
// Does the user have permission to view this thread? // Does the user have permission to view this thread?
if($forumpermissions['canview'] != 1 || $forumpermissions['canviewthreads'] != 1 ) if($forumpermissions['canview'] != 1 || $forumpermissions['canviewthreads'] != 1 )
{ {
error_no_permission(); error_no_permission();
} }
if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canon lyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid']) if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canon lyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])
{ {
skipping to change at line 944 skipping to change at line 948
if($mybb->get_input('page', MyBB::INPUT_INT) && $mybb->get_input( 'page') != "last") if($mybb->get_input('page', MyBB::INPUT_INT) && $mybb->get_input( 'page') != "last")
{ {
$page = $mybb->get_input('page', MyBB::INPUT_INT); $page = $mybb->get_input('page', MyBB::INPUT_INT);
} }
if(!empty($mybb->input['pid'])) if(!empty($mybb->input['pid']))
{ {
$post = get_post($mybb->input['pid']); $post = get_post($mybb->input['pid']);
if(empty($post) || ($post['visible'] == 0 && !is_moderato r($post['fid'], 'canviewunapprove')) || ($post['visible'] == -1 && !is_moderator ($post['fid'], 'canviewdeleted') && $forumpermissions['canviewdeletionnotice'] = = 0)) if(empty($post) || ($post['visible'] == 0 && !is_moderato r($post['fid'], 'canviewunapprove')) || ($post['visible'] == -1 && !is_moderator ($post['fid'], 'canviewdeleted') && $forumpermissions['canviewdeletionnotice'] = = 0))
{ {
$footer .= '<script type="text/javascript">$(docu ment).ready(function() { $.jGrowl(\''.$lang->error_invalidpost.'\', {theme: \'jg rowl_error\'}); });</script>'; $footer .= '<script type="text/javascript">$(func tion() { $.jGrowl(\''.$lang->error_invalidpost.'\', {theme: \'jgrowl_error\'}); });</script>';
} }
else else
{ {
$query = $db->query(" $query = $db->query("
SELECT COUNT(p.dateline) AS count FROM ". TABLE_PREFIX."posts p SELECT COUNT(p.dateline) AS count FROM ". TABLE_PREFIX."posts p
WHERE p.tid = '{$tid}' WHERE p.tid = '{$tid}'
AND p.dateline <= '{$post['dateline']}' AND p.dateline <= '{$post['dateline']}'
{$visible} {$visible}
"); ");
$result = $db->fetch_field($query, "count"); $result = $db->fetch_field($query, "count");
skipping to change at line 1058 skipping to change at line 1062
} }
if($defaultmode != "linear") if($defaultmode != "linear")
{ {
$threadmode = "&amp;mode=linear"; $threadmode = "&amp;mode=linear";
} }
} }
$multipage = multipage($postcount, $perpage, $page, str_replace("{tid}", $tid, THREAD_URL_PAGED.$highlight.$threadmode)); $multipage = multipage($postcount, $perpage, $page, str_replace("{tid}", $tid, THREAD_URL_PAGED.$highlight.$threadmode));
// Allow originator to see own unapproved posts
if($mybb->user['uid'] && $mybb->settings['showownunapproved'])
{
$visible .= " OR (p.tid='$tid' AND p.visible='0' AND p.ui
d=".$mybb->user['uid'].")";
}
// Lets get the pids of the posts on this page. // Lets get the pids of the posts on this page.
$pids = ""; $pids = "";
$comma = ''; $comma = '';
$query = $db->simple_select("posts p", "p.pid", "p.tid='$tid' $vi sible", array('order_by' => 'p.dateline', 'limit_start' => $start, 'limit' => $p erpage)); $query = $db->simple_select("posts p", "p.pid", "p.tid='$tid' $vi sible", array('order_by' => 'p.dateline', 'limit_start' => $start, 'limit' => $p erpage));
while($getid = $db->fetch_array($query)) while($getid = $db->fetch_array($query))
{ {
// Set the ID of the first post on page to $pid if it doe sn't hold any value // Set the ID of the first post on page to $pid if it doe sn't hold any value
// to allow this value to be used for Thread Mode/Linear Mode links // to allow this value to be used for Thread Mode/Linear Mode links
// and ensure the user lands on the correct page after ch anging view mode // and ensure the user lands on the correct page after ch anging view mode
if(empty($pid)) if(empty($pid))
 End of changes. 4 change blocks. 
3 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)