Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
dad7732
RavenNuke(tm) Development Team



Joined: Mar 18, 2007
Posts: 1242

PostPosted: Thu Nov 26, 2009 8:42 pm Reply with quote

Changed HideLinksFromGuests from the default "FALSE" to "TRUE".

Then this appeared at the top of the block display above the xml icon:

Quote:
$(document).ready(function(){ $("#main_topic").siblings(".child_topic").show(); $("#show_hide").click(function(){ //$("#main_topic").siblings(".child_topic").toggle(); var elem = $(".child_topic")[0]; if(elem.style.display == "none") { $(".child_topic").show(); } else { $(".child_topic").hide(); } return false; }); });


Not only that but the display went back to a three-post display from the 25 I had configured.
 
View user's profile Send private message
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Fri Nov 27, 2009 7:40 am Reply with quote

Something else in the block must have been changed.

Code:
$content = '

<script type="text/javascript" language="JavaScript">
   $(document).ready(function(){
      $("#main_topic").siblings(".child_topic").hide();
      $("#show_hide").click(function(){
         //$("#main_topic").siblings(".child_topic").toggle();
         var elem = $(".child_topic")[0];
         if(elem.style.display == "none") {
            $(".child_topic").show();
         } else {
            $(".child_topic").hide();
         }
         return false;
      });
   });
</script>';


This is the block code that controls that javascript. Check and see if something was changed.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
dad7732







PostPosted: Fri Nov 27, 2009 8:22 am Reply with quote

Here is the code in the default 2.4 block:

Quote:
$content = '
<script type="text/javascript" language="JavaScript">
$(document).ready(function(){
$("#main_topic").siblings(".child_topic").show();
$("#show_hide").click(function(){
//$("#main_topic").siblings(".child_topic").toggle();
var elem = $(".child_topic")[0];
if(elem.style.display == "none") {
$(".child_topic").show();
} else {
$(".child_topic").hide();
}
return false;
});
});
</script>';


Only thing I see is in line 4, yours shows .hide and mine shows .show

Here are my settings:

Quote:
$hideLinksFromGuests = FALSE;
$hideTheseForums = '-1'; // use a comma delimited list of forum id's to hide like '1,5,8'
$tickerBGColor = $bgcolor2;
$tickDelay = 4000; // in miliseconds
$hideViewReadOnly = TRUE;
$lastNewTopics = 25; // Number of topics to show when list is expanded
$countTopics = 0;
$showClosedNum = 3; // Number of messages that are visible when collapsed
$showJumpBoxes = TRUE; // Display or don't display the 2 Jump Boxes
$showTopPosters = 2; // 0=None, 1=Username - no avatar, 2=Username and avatar
$showTopPostersRanks = 4; // 0=None, 1=Admin only, 2=Moderator only, 3=Admin and Moderator, 4=All
$showTopPostersNum = 5; // Total number of top posters to show
$showTopPostersPerRow = 5; // Number to show per line
$showTickerMessage = false; // show/hide the top ticker message
$skipTopPostersUserNames = "'Anonymous'"; // use a comma separated list with each name in single quotes, like 'user1','user2'.
$backendForumsXML = 'forumsbackend.php'; //Filename of the xml script. Assumed in root directory.



If I change FALSE to TRUE in the first line is when the error shows up.

See any problems?

Cheers
 
dad7732







PostPosted: Fri Nov 27, 2009 8:39 am Reply with quote

Changed my .show to .hide and all that did was to override the custom show/hide setting as far as I can tell, still didn't remove the error text.

Cheers
 
nuken







PostPosted: Fri Nov 27, 2009 4:34 pm Reply with quote

paste your block code in here.
 
dad7732







PostPosted: Fri Nov 27, 2009 7:20 pm Reply with quote

The block code is the default that ships with the 2.4 bits with the exception of my personal settings where provided. All works except the first line when set to true.

Code:
<?php

########################################################################
# This program is free software. You can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License.       #
# If you modify this, let me know for fun. =)                          #
########################################################################
# Raven modified (heavily) to use a collapsing table structure.        #
# Date Released: Original: 01/23/2004                                  #
#              : v2.0.0  : 07/14/2005                                  #
#              : v2.0.1  : 07/16/2005                                  #
#              : v2.1.0  : 08/21/2005                                  #
#              : v2.2.0  : 10/23/2005                                  #
#              : v2.3.0  : 01/19/2006                                  #
#              : v2.3.1  : 02/13/2006                                  #
#              : v2.3.2  : 03/14/2007                                  #
#              : v2.3.3  : 03/17/2007                                  #
#              : v2.3.4  : 09/21/2008                                  #
# Support      : http://ravenphpscripts.com                            #
# Hosting      : http://ravenwebhosting.com                            #
# RavenNuke(tm): http://ravennuke.com                                  #
# Version: 2.3.4                                                       #
########################################################################
# Version 2.3.4                                                        #
# 09/21/2008  : Converted all the & to &amp;.  I'm not sure why I had  #
#             : not done before but it is done now!                    #
# Version 2.3.3                                                        #
# 03/17/2007  : Modified the code to allow the backendforums xml icon  #
#             : to show when Show Top Posters is NOT selected.         #
# Version 2.3.2                                                        #
# 03/14/2007  : Corrected reference to hard coded "forumsbackend.php"  #
#             : to reference the "$backendForumsXML" setting.  Thanks  #
#             : to Misha for pointing this out.                        #
# Version 2.3.1                                                        #
# 02/13/2006  : Modified default empty $skipTopPostersUserNames="''"   #
#             : due to certain releases of MySQL behavior.             #
#             : Added setting ($showTickerMessage) to control ticker   #
# Version 2.3.0                                                        #
# 11/27/2005  : Modified behavior of $showJumpBox to $showJumpBoxes    #
#             : Added setting ($showTickerMessage) to control ticker   #
# 11/13/2005  : Converted drop down boxes to use FieldSet              #
#             : Removed underlining of Jump To boxes                   #
#             : Added style tag for text color to optgroup             #
# 01/19/2006  : Added style sheet for show/hide button                 #
#             : Moved language defines to their own language folder    #
# Version 2.2.0                                                        #
# 10/23/2005  : Released.                                              #
# 10/23/2005  : Automated the recognizing of Admin and Moderators.     #
# 10/21/2005  : Restored some links that had been mistakenly GT'd.     #
# 10/20/2005  : Fixed links and titles for differentiatng forum, topic #
#               and last topic post.        .                          #
# 10/19/2005  : Added setting for number of posters/row and automated  #
#               the newline routine for same.                          #
# 10/15/2005  : Modified TopTenPoster verbiage and code to Top Posters.#
#               to allow for varying number to show.                   #
# 10/16/2005  : Modified code to not show hyper-links of profiles to   #
#               Anaonymous users.  This is for better SEO. It is       #
#               controllable through setting $hideLinksFromGuests      #
# Version 2.1.0                                                        #
# 08/21/2005  : Added routine to allow manual hiding of selected forums#
#               Renamed a few variables for standardization purposes.  #
# 08/20/2005  : Added routine to adjust displayed post time by profile #
# 08/13/2005  : Added border="0" to xmlicon - Thanks CurtisH           #
#               Added manual routines to recognise admins and mods in  #
#               order to hilite their roles when mousing over their    #
#               icons in the Top 10 posters. This could be automated,  #
#               but until that happens, this will suffice.             #
# Version 2.0.1                                                        #
# 07/16/2005  : Fixed layout of ticking message                        #
# Version 2.0.0                                                        #
# 07/14/2005  : Added a drop down box for a Jump-To Forum.  This was   #
#               suggested by ring_c. It has an optional switch.        #
#             : Converted several navigational links to drop down.     #
#             : Converted all text to language defines.                #
#             : Created some settings to make more flexible.           #
#             : Added ability to exclude user names from top ten list. #
# 06/19/2005  : Removed some not used code.                            #
#               Added top ten posters with avatars.  Made it optional. #
# 05/03/2005  : Added Watched Posts to header menu                     #
# 02/14/2004  : optimized sql for faster building                      #
# 05/25/2004  : Added code to identify the Forum and Section           #
# 06/28/2004  : Fixed code to show the Forum and Section when NOT in   #
#               hideViewReadOnly mode.                                 #
# 12/03/2004  : Added truncation to poster name and last replied name. #
########################################################################

global $admin, $bgcolor1, $bgcolor2, $db, $prefix, $sitename, $textcolor1, $textcolor2, $user, $user_prefix, $currentlang, $language;

$hideLinksFromGuests = FALSE;
$hideTheseForums = '-1';  // use a comma delimited list of forum id's to hide like '1,5,8'
$tickerBGColor = $bgcolor2;
$tickDelay = 4000; // in miliseconds
$hideViewReadOnly = TRUE;
$lastNewTopics = 25; // Number of topics to show when list is expanded
$countTopics = 0;
$showClosedNum = 3; // Number of messages that are visible when collapsed
$showJumpBoxes = TRUE; // Display or don't display the 2 Jump Boxes
$showTopPosters = 2;  // 0=None, 1=Username - no avatar,  2=Username and avatar
$showTopPostersRanks = 4;  // 0=None, 1=Admin only, 2=Moderator only, 3=Admin and Moderator, 4=All
$showTopPostersNum = 5;  // Total number of top posters to show
$showTopPostersPerRow = 5;  // Number to show per line
$showTickerMessage = false; // show/hide the top ticker message
$skipTopPostersUserNames = "'Anonymous'"; // use a comma separated list with each name in single quotes, like 'user1','user2'.
$backendForumsXML = 'forumsbackend.php';  //Filename of the xml script.  Assumed in root directory.

//////////////////////////////////////////////////////////////////
// THERE SHOULD BE NO NEED TO EDIT BELOW THIS LINE
if ( !defined('BLOCK_FILE') ) {
   Header('Location: ../index.php');
   die();
}

if(file_exists('language/rwsforumcollapsing/lang-'.$currentlang.'.php')) {
   require('language/rwsforumcollapsing/lang-'.$currentlang.'.php');
} elseif(file_exists('language/rwsforumcollapsing/lang-'.$language.'.php')) {
   require('language/rwsforumcollapsing/lang-'.$language.'.php');
} else {
   require 'language/rwsforumcollapsing/lang-english.php';
}

//
// The following should not be changed.  If you need to modify them, modify them in the language folder.
// These are strictly local scope
$bfcShowHide = bfcSHOWHIDEBUTTONTEXT;
$bfcJumpForum = bfcJUMPFORUM;
$bfcJumpFunction = bfcJUMPFUNCTION;
$bfcForum = bfcFORUM;
$bfcTopic = bfcTOPIC;
$bfcReplies = bfcREPLIES;
$bfcAuthor = bfcAUTHOR;
$bfcViews = bfcVIEWS;
$bfcLastPost = bfcLASTPOST;

// Calculate posting time offset for user defined timezones
$serverTimeZone = date('Z') / 3600;
if ($serverTimeZone >= 0) {
   $serverTimeZone = '+' . $serverTimeZone;
}
if (is_user($user)) {
   $userinfo = getusrinfo($user);
   $userTimeZone = $userinfo['user_timezone'];
} else {
   $sql  = 'SELECT `config_value` FROM `' . $user_prefix . '_bbconfig` WHERE `config_name`="board_timezone"';
   $result = $db->sql_query($sql);
   $rows = $db->sql_fetchrow($result);
   $userTimeZone = $rows['config_value'];
}
$userTimeZone = ($userTimeZone - $serverTimeZone) * 3600;
if (!is_numeric($userTimeZone)) {
   $userTimeZone = 0;
}

$content = '
<script type="text/javascript" language="JavaScript">
   $(document).ready(function(){
      $("#main_topic").siblings(".child_topic").show();
      $("#show_hide").click(function(){
         //$("#main_topic").siblings(".child_topic").toggle();
         var elem = $(".child_topic")[0];
         if(elem.style.display == "none") {
            $(".child_topic").show();
         } else {
            $(".child_topic").hide();
         }
         return false;
      });
   });
</script>';

if ($showTickerMessage) {
   $content .= '
   <script type="text/javascript" language="JavaScript">
      var current_topic;
      var vurrent_topic_html;
      var old_topic = -1;
      var topic_count;
      var topic_interval;

      $(document).ready(function(){
         topic_count = $("tr.child_topic").size();
         topic_interval = setInterval(topic_rotate,' . $tickDelay . ');
         topic_rotate();
      });

      function topic_rotate() {
         current_topic = (old_topic + 1) % topic_count;
         current_topic_html = $("tr.child_topic:eq(" + current_topic + ")").html();
         $("tr#main_topic").html(current_topic_html);
         old_topic = current_topic;
      }
   </script>';
}

if (strlen($backendForumsXML)>0) {
   $content .= '<div style="text-align: center"><a href="' . $backendForumsXML . '" title="' . bfcBACKENDTITLE . '"><img src="images/blocks/xmlicon.gif" alt="" border="0" /></a></div><br />';
}

if ($showTopPosters==1 || $showTopPosters==2) {
   $sql = 'SELECT `user_id`, `username`, `user_posts`, `user_avatar`, `user_level`, `rank_title`, `rank_id` FROM `' . $user_prefix . '_users` u LEFT JOIN `' . $user_prefix . '_bbranks`'
      . ' r on u.user_rank=r.rank_id WHERE `username` NOT IN (' . $skipTopPostersUserNames . ') ORDER BY `user_posts` DESC LIMIT 0,' . $showTopPostersNum;
   $result=$db->sql_query($sql);
   $num_posters=$db->sql_numrows($result);
   $content .= '<div style="text-align: center"><span style="font-weight: bold; text-decoration: underline;">' . bfcTOPPOSTERS . '</span><br /><br /><table class="outer" cellpadding="0"'
         . ' style="border-collapse: collapse; border-color: ' . $textcolor1 . '; margin: 0 auto; vertical-align: middle;" cellspacing="1" border="0">';
   $cycle = 1;
   $content .= '<tr class="even">';
   while(list($user_id, $username, $user_posts, $user_avatar, $user_level, $rank_title, $rank_id) = $db->sql_fetchrow($result)) {
      $staffTitle = '';
      if ($showTopPostersRanks==3) {
         if ($user_level==2||$user_level==3) {
            $staffTitle = 'title="' . $rank_title . '"';
         } else {
            $staffTitle = '';
         }
      } elseif ($showTopPostersRanks==4) {
         $staffTitle = 'title="' . $rank_title . '"';
      } elseif ($showTopPostersRanks==1) {
         if ($user_level==2) {
            $staffTitle = 'title="' . $rank_title . '"';
         } else {
            $staffTitle = '';
         }
      } elseif ($showTopPostersRanks==2) {
         if ($user_level==3) {
            $staffTitle = 'title="' . $rank_title . '"';
         } else {
            $staffTitle = '';
         }
      }

      $newLine = FALSE;
      if ($showTopPosters==2) {
         $content .= '<td align="center">';
         if ($user_avatar == '') {
            $content .= '&nbsp;&nbsp;<a href="modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=' . $user_id . '" ' . $staffTitle . '>'
                  . '<img alt="" src="modules/Forums/images/avatars/noimage.gif" border ="0" width="32" /></a></td>';
         } elseif (eregi('http://', $user_avatar)) {
            $content .= '&nbsp;&nbsp;<a href="modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=' . $user_id . '" ' . $staffTitle . '>'
                  . '<img alt="" src="' . $user_avatar . '" border ="0" width="32" /></a></td>';
         } else {
            $content .= '&nbsp;&nbsp;<a href="modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=' . $user_id . '" ' . $staffTitle . '>'
                  . '<img alt="" src="modules/Forums/images/avatars/' . $user_avatar . '" border ="0" width ="32" /></a></td>';
         }
      }
      $content .= '<td>&nbsp;<a href="modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=' . $user_id . '" ' . $staffTitle . '>'
            . '<span style="font-weight: bold;">' . $username . '</span></a>&nbsp;<br />&nbsp;'
            . '<a href="modules.php?name=Forums&amp;file=search&amp;mode=results&amp;search_author=' . $username . '" ' . $staffTitle . '>Posts:</a>'
            . '&nbsp;<a href="modules.php?name=Forums&amp;file=search&amp;mode=results&amp;search_author=' . $username . '" ' . $staffTitle . '>' . $user_posts . '</a>&nbsp;</td>';
      if (!($cycle%$showTopPostersPerRow) || $cycle == $num_posters) {
         $content .= '</tr>';
      }
      $cycle++;
   }
   $content .= '</table></div><br />';
}
if ($hideLinksFromGuests && !(is_admin($admin) || is_user($user))) {
   $content = strip_tags($content, '<tr><td><img><table><div>');
}

if ($showJumpBoxes) {
   define('IN_PHPBB',TRUE);
   include_once 'modules/Forums/includes/constants.php';
   $sql = 'SELECT c.cat_id, c.cat_title, c.cat_order
         FROM `' . $user_prefix . '_bbcategories` c, `' . $user_prefix . '_bbforums` f
         WHERE f.cat_id = c.cat_id
         GROUP BY c.cat_id, c.cat_title, c.cat_order
         ORDER BY c.cat_order';
   if ( !($result = $db->sql_query($sql)) ) {
      $content = bfcGETCATEGORYLISTERROR . bfcMYSQLSAID . mysql_error();
   }

   $category_rows = array();
   while ( $row = $db->sql_fetchrow($result) ) {
      $category_rows[] = $row;
   }

   if ( $total_categories = count($category_rows) ) {
      $sql = 'SELECT *
            FROM `' . $user_prefix . '_bbforums`
            ORDER BY `cat_id`, `forum_order`';
      if ( !($result = $db->sql_query($sql)) ) {
         $content = bfcGETFORUMINFOERROR . bfcMYSQLSAID . mysql_error();
      }

      $boxstring = '<select name="' . POST_FORUM_URL . '" onchange="if(this.options[this.selectedIndex].value != -1){ top.location.href=this.options[this.selectedIndex].value }">'
               . '<optgroup label="' . 'Select Forum' . '" style="color:' . $textcolor2 . '"><option value="-1">&nbsp;</option></optgroup>';

      $forum_rows = array();
      while ( $row = $db->sql_fetchrow($result) ) {
         $forum_rows[] = $row;
      }

      if ( $total_forums = count($forum_rows) ) {
         for($i = 0; $i < $total_categories; $i++) {
            $boxstring_forums = '';
            for($j = 0; $j < $total_forums; $j++) {
               if ( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && $forum_rows[$j]['auth_view'] <= AUTH_REG ) {
                  $boxstring_forums .=  '<option value="modules.php?name=Forums&amp;file=viewforum&amp;f=' . $forum_rows[$j]['forum_id'] . '">' . $forum_rows[$j]['forum_name'] . '</option>';
               }
            }

            if ( $boxstring_forums != '' ) {
               $boxstring .= '<optgroup label="' . $category_rows[$i]['cat_title'] . '" style="color:' . $textcolor2 . '">';
               $boxstring .= $boxstring_forums . '</optgroup>';
            }
         }
      }
      $boxstring .= '</select>';
   } else {
      $boxstring = '<select name="' . POST_FORUM_URL . '" onchange="if(this.options[this.selectedIndex].value != -1){ top.location.href=this.options[this.selectedIndex].value }"></select>';
   }

   if ( !empty($SID) ) {
      $boxstring .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';
   }
}

$links = '<select onchange="if(this.options[this.selectedIndex].value != -1){ top.location.href=this.options[this.selectedIndex].value }">'
      . '<optgroup style="color:' . $textcolor2 . ';" label="' . bfcSELECT . '"><option value="-1">&nbsp;</option>';
$links .= '<option value="modules.php?name=Forums&amp;file=search&amp;search_id=unanswered">' . bfcVIEWUNANSWEREDPOSTS . '</option>';
$links .= '<option value="modules.php?name=Forums">' . bfcFORUMINDEX . '</option>';
$links .= '<option value="modules.php?name=Forums&amp;file=search">' . bfcSEARCHFORUMS . '</option>';
if (is_user($user)) {
   $links .= '<option value="modules.php?name=Forums&amp;file=search&amp;search_id=newposts">' . bfcVIEWPOSTSSINCELASTVISIT . '</option>';
   $links .= '<option value="modules.php?name=Forums&amp;file=search&amp;search_id=egosearch">' . bfcVIEWYOURPOSTS . '</option>';
   $links .= '<option value="modules.php?name=Watched_Topics">' . bfcWATCHEDTOPICS . '</option>';
   $links .= '<option value="modules.php?name=Forums&amp;file=profile&amp;mode=editprofile">' . bfcPROFILE . '</option>';
   $links .= '<option value="modules.php?name=Private_Messages&amp;file=index&amp;folder=inbox">' . bfcPRIVATEMESSAGES . '</option>';
}
$links .= '</optgroup></select>';
$content .= '<div style="text-align: center">';
if ($showJumpBoxes) {
   $content .= '<table width="100%"><tr>'
         . '<td><span style="font-weight: bold;">' . $bfcJumpFunction . '</span></td>'
         . '<td><span style="font-weight: bold;">' . $bfcJumpForum . '</span></td></tr>'
         . '<tr><td>' . $links . '</td><td>' . $boxstring . '</td></tr>'
         . '</table><br />';
}
$content .= '<table style="background-color: ' . $tickerBGColor . ';"><tr>'
      . '<th height="25" width="100%" nowrap="nowrap"><font color="' . $textcolor1 . '"><strong><span style="font-style: italic;">[' . $bfcForum . ']</span>&nbsp;' . $bfcTopic . '</strong></font></th>'
      . '<th height="25" nowrap="nowrap"><font color="' . $textcolor1 . '"><strong>&nbsp;' . $bfcReplies . '&nbsp;</strong></font></th>'
      . '<th height="25" nowrap="nowrap"><font color="' . $textcolor1 . '"><strong>&nbsp;' . $bfcAuthor . '&nbsp;</strong></font></th>'
      . '<th height="25" nowrap="nowrap"><font color="' . $textcolor1 . '"><strong>&nbsp;' . $bfcViews . '&nbsp;</strong></font></th>'
      . '<th height="25" nowrap="nowrap"><font color="' . $textcolor1 . '"><strong>&nbsp;' . $bfcLastPost . '&nbsp;</strong></font></th>'
      . '</tr>';

if ($showTickerMessage) {
   $id = '';
} else {
   $id = ' id="main_topic"';
}
$content .=   '<tr' . $id . ' bgcolor="' . $tickerBGColor . '"><td colspan="4"><div style="text-align: left;">'.bfcSHOWHIDELABELTEXT.'</div></td>'
      . '<td id="show_hide"><div style="margin: 0 auto; border: 1px solid #4B4B4B; background-color: ' . $bgcolor1 . '; width: 60px; height: 12px; font: normal 11px Arial, Verdana, Helvetica, sans-serif; text-align: center;'
      . ' cursor: pointer;">' . $bfcShowHide . '</div></td></tr>';

if ($showTickerMessage) {
   $content .= '<tr id="main_topic"><td bgcolor="' . $bgcolor1 . '" class="row1"></td>'
         . '<td bgcolor="' . $bgcolor1 . '" class="row2"></td>'
         . '<td bgcolor="' . $bgcolor1 . '" class="row3"></td>'
         . '<td bgcolor="' . $bgcolor1 . '" class="row2"></td>'
         . '<td bgcolor="' . $bgcolor1 . '" class="row3"></td></tr>';
}

$result = $db->sql_query( 'SELECT t.topic_id, t.forum_id, t.topic_last_post_id, t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, t.topic_moved_id, t.topic_status, f.forum_name'
                  . ' FROM `' . $user_prefix . '_bbtopics` t, `' . $user_prefix . '_bbforums` f'
                  . ' WHERE t.forum_id NOT IN(' . $hideTheseForums . ') AND t.forum_id=f.forum_id ORDER BY t.topic_last_post_id DESC');

$cnt = 0;
while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id, $topic_status, $forum_name ) = $db->sql_fetchrow( $result ) ) {
   $skip_display = 0;
   $result1 = $db->sql_query( 'SELECT `auth_view`, `auth_read`, `forum_name`, `cat_id` FROM `' . $user_prefix . '_bbforums` WHERE `forum_id` = "' . $forum_id . '"');
   list( $auth_view, $auth_read, $forum_name, $cat_id ) = $db->sql_fetchrow( $result1 );

   if( $hideViewReadOnly) {
      if( ( $auth_view != 0 ) || ( $auth_read != 0 ) ) {
         $skip_display = 1;
      }
   }

   if( $topic_moved_id != 0 ) {
      // Shadow Topic !!
      $skip_display = 1;
   }

   if( $skip_display == 0 ) {
      if ($cnt >= $showClosedNum) {
         $class = ' class="child_topic" style="display: none"';
      } else {
         $class = '';
      }
      $countTopics += 1;
      $result5 = $db->sql_query('SELECT `cat_title` FROM `' . $user_prefix . '_bbcategories` WHERE `cat_id`="' . $cat_id . '"');
      list($cat_title)=$db->sql_fetchrow($result5);
      $result2 = $db->sql_query('SELECT `username`, `user_id` FROM `' . $user_prefix . '_users` WHERE `user_id`="' . $topic_poster . '"');
      list($username, $user_id)=$db->sql_fetchrow($result2);
      $avtor=$username;
      $sifra=$user_id;
      $result4 = $db->sql_query('SELECT u.username, u.user_id, p.poster_id, FROM_UNIXTIME(p.post_time + ' . $userTimeZone . ') as post_time'
                        . ' FROM `' . $user_prefix . '_users` u, `' . $user_prefix . '_bbposts` p WHERE u.user_id=p.poster_id AND p.post_id="' . $topic_last_post_id . '"');
      list($username, $user_id, $poster_id, $post_time)=$db->sql_fetchrow($result4);
      $_username = substr($username,0,15);
      $_avtor = substr($avtor,0,15);
      if ($topic_status) {
         $lockTopic = '<img src="/images/blocks/locktopicgray.gif" width="14" height="14" alt="' . bfcTOPICLOCKED . '" title="' . bfcTOPICLOCKED . '" border="none" /> ';
      } else {
         $lockTopic = '';
      }
      if (!$hideLinksFromGuests || is_admin($admin) || is_user($user)) {
         $content .= '<tr' . $class .'><td bgcolor="' . $bgcolor1 . '" class="row1"><div style="text-align: left;">&nbsp;&nbsp;&nbsp;<span style="text-decoration: none; font-style: italic"><a href="modules.php?name=Forums&amp;file=viewforum&amp;f=' . $forum_id . '" title="' . $forum_name . '">'
               . '[' . $cat_title . ':&nbsp;' . $forum_name . ']</a><br />'
               . '&nbsp;&nbsp;&nbsp;<a href="modules.php?name=Forums&amp;file=viewtopic&amp;t=' . $topic_id . '" title="' . $topic_title . '">&nbsp;' . $lockTopic . $topic_title . '</a></span></div>'
               . '</td><td bgcolor="' . $bgcolor1 . '" class="row2">' . $topic_replies . '</td><td bgcolor="' . $bgcolor1 . '" class="row3">'
               . '<a href="modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=' . $sifra . '">&nbsp;&nbsp;' . $_avtor . '&nbsp;&nbsp;</a></td><td bgcolor="' . $bgcolor1 . '" class="row2">' . $topic_views . '</td>'
               . '<td nowrap="nowrap" bgcolor="' . $bgcolor1 . '" class="row3"><font size="-2" style="font-style: italic;">&nbsp;&nbsp;' . $post_time . '&nbsp;&nbsp;</font><br />'
               . '<a href="modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=' . $user_id . '">&nbsp;&nbsp;' . $_username . '&nbsp;&nbsp;</a>&nbsp;<a href="modules.php?name=Forums&amp;file=viewtopic&amp;p=' . $topic_last_post_id . '#' . $topic_last_post_id . '">'
               . '<img src="images/blocks/icon_minipost_new.gif" alt="" border="0" /></a></td></tr>';
      } else {
         $content .= '<tr' . $class . '><td bgcolor="' . $bgcolor1 . '" class="row1"><a href="modules.php?name=Forums&amp;file=viewtopic&amp;p=' . $topic_last_post_id . '#' . $topic_last_post_id . '" title="' . $topic_title . '">'
               . '<span style="text-decoration: none; font-style: italic">[' . $cat_title . ':&nbsp;' . $forum_name . ']</span><br />&nbsp;' . $lockTopic . $topic_title . '</a></td>'
               . '<td bgcolor="' . $bgcolor1 . '" class="row2">' . $topic_replies . '</td><td bgcolor="' . $bgcolor1 . '" class="row3">' . $_avtor . '</td>'
               . '<td bgcolor="' . $bgcolor1 . '" class="row2">' . $topic_views . '</td><td nowrap="nowrap" bgcolor="' . $bgcolor1 . '" class="row3">'
               . '<font size="-2" style="font-style: italic;">&nbsp;&nbsp;' . $post_time . '&nbsp;</font><br />' . $_username . '</td></tr>';
      }
      $content = str_replace(chr(153), '(tm)', $content);
      $cnt++;
   }
   if( $lastNewTopics == $countTopics ) {
      break 1;
   }

}

$content .= '</table></div>';

?>
 
nuken







PostPosted: Fri Nov 27, 2009 7:55 pm Reply with quote

I can't duplicate the error you are having. I tried it with all themes and it works like it should for me.
 
dad7732







PostPosted: Fri Nov 27, 2009 9:15 pm Reply with quote

Did you try it with my custom config in the block code? If that works for you and not for me then I'll have to look elsewhere for the problem.

Cheers
 
nuken







PostPosted: Fri Nov 27, 2009 9:23 pm Reply with quote

I used what you pasted above and it worked for me.
 
dad7732







PostPosted: Fri Nov 27, 2009 9:54 pm Reply with quote

Was hoping you wouldn't say that .. I didn't try anything other than Firefox .. maybe THAT is the problem here, dunno.

Thanks
 
dad7732







PostPosted: Fri Nov 27, 2009 9:58 pm Reply with quote

Not the browser, tried IE, NS 7, etc. same problem.

Did you change:

$hideLinksFromGuests = FALSE;

to TRUE? That's what triggers the problem here.
 
nuken







PostPosted: Sat Nov 28, 2009 8:28 am Reply with quote

You are right, it does. I will look at it today and try to see what is causing it.
 
dad7732







PostPosted: Sat Nov 28, 2009 8:38 am Reply with quote

Whewww, thank goodness, now I don't have to spend the rest of Saturday investigating my site .. yowza!

But I think this warrants starting a Mantis issue, I'll take care of that one.

Cheers
 
dad7732







PostPosted: Sat Nov 28, 2009 8:47 am Reply with quote

Mantis issue reported: ID 0001643
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sat Nov 28, 2009 6:17 pm Reply with quote

Open blocks/block-ForumsCollasping.php and find:
Code:


$content = '
<script type="text/javascript" language="JavaScript">
   $(document).ready(function(){
      $("#main_topic").siblings(".child_topic").hide();
      $("#show_hide").click(function(){
         //$("#main_topic").siblings(".child_topic").toggle();
         var elem = $(".child_topic")[0];
         if(elem.style.display == "none") {
            $(".child_topic").show();
         } else {
            $(".child_topic").hide();
         }
         return false;
      });
   });
</script>';

if ($showTickerMessage) {
   $content .= '
   <script type="text/javascript" language="JavaScript">
      var current_topic;
      var vurrent_topic_html;
      var old_topic = -1;
      var topic_count;
      var topic_interval;

      $(document).ready(function(){
         topic_count = $("tr.child_topic").size();
         topic_interval = setInterval(topic_rotate,' . $tickDelay . ');
         topic_rotate();
      });

      function topic_rotate() {
         current_topic = (old_topic + 1) % topic_count;
         current_topic_html = $("tr.child_topic:eq(" + current_topic + ")").html();
         $("tr#main_topic").html(current_topic_html);
         old_topic = current_topic;
      }
   </script>';
}

if (strlen($backendForumsXML)>0) {

Replace with:
Code:


$javascript_content = '
<script type="text/javascript" language="JavaScript">
   $(document).ready(function(){
      $("#main_topic").siblings(".child_topic").hide();
      $("#show_hide").click(function(){
         //$("#main_topic").siblings(".child_topic").toggle();
         var elem = $(".child_topic")[0];
         if(elem.style.display == "none") {
            $(".child_topic").show();
         } else {
            $(".child_topic").hide();
         }
         return false;
      });
   });
</script>';

if ($showTickerMessage) {
   $javascript_content .= '
   <script type="text/javascript" language="JavaScript">
      var current_topic;
      var vurrent_topic_html;
      var old_topic = -1;
      var topic_count;
      var topic_interval;

      $(document).ready(function(){
         topic_count = $("tr.child_topic").size();
         topic_interval = setInterval(topic_rotate,' . $tickDelay . ');
         topic_rotate();
      });

      function topic_rotate() {
         current_topic = (old_topic + 1) % topic_count;
         current_topic_html = $("tr.child_topic:eq(" + current_topic + ")").html();
         $("tr#main_topic").html(current_topic_html);
         old_topic = current_topic;
      }
   </script>';
}

$content = '';

if (strlen($backendForumsXML)>0) {


Then find:
Code:


if ($hideLinksFromGuests && !(is_admin($admin) || is_user($user))) {
   $content = strip_tags($content, '<tr><td><img><table><div>');
}

if ($showJumpBoxes) {

Replace with:
Code:


if ($hideLinksFromGuests && !(is_admin($admin) || is_user($user))) {
   $content = strip_tags($content, '<tr><td><img><table><div>');
}

$content = $javascript_content . $content;

if ($showJumpBoxes) {

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
dad7732







PostPosted: Sat Nov 28, 2009 11:38 pm Reply with quote

That works, error is not displayed any longer .. but .. Changing FALSE to TRUE to hide the links doesn't work, guests can still see links. Sad

Cheers
 
Palbin







PostPosted: Sun Nov 29, 2009 1:01 am Reply with quote

All links should be gone except the links to the forums. That is the way it is written. If you want to remove the forum links as well there is an IF ELSE statement you can edit in the block. The ELSE statement only containing the one remaining link.
 
dad7732







PostPosted: Sun Nov 29, 2009 8:42 am Reply with quote

Guess I'm still lost. Exactly what links are supposed to be hidden? At first I thought the liinks in the forums would be hidden but they aren't like you mention. The links in the block itself?? Still there, so I have no clue as to what links are supposed to be hidden from guests. Sad

Also, the links to the forums and posts are now centered instead of left justified. No biggie, just noticed that change.

Cheers, we'll get there eventually.

PS: Just noticed that the links to the "forum" is gone but the link to the "topic" is there. Is THAT the link that is supposed to be hidden? And if so, what's the purpose of hidding that link? (confused)

And the IF ELSE statement is "where"?
 
dad7732







PostPosted: Sun Nov 29, 2009 10:17 am Reply with quote

Interesting ... In the block, the topics links are centered for "guests" but left-justified for reg'd users and admin.

And the links to the "forums" are hidden as intended for guests. I would guess this is for the benefit of robots although the bots can still access via the forums link in the main menu??

Actually I am more interested in hiding links posted in the topics/replies, etc.

Thanks for all responses to this issue.

Cheers
 
Palbin







PostPosted: Sun Nov 29, 2009 11:37 am Reply with quote

The centering thing should be fixed with the file I put on the svn last night. I will take a look at the links for the forum/topic again.
 
dad7732







PostPosted: Sun Nov 29, 2009 11:41 am Reply with quote

Centering is no big deal, just looks different.

What and where do I add the code to hide links in the topics as this would be great so that only reg'd users can "see" posted links such as in this forum for instance along with the graphic telling the "guest" that you have to be reg'd to see the link. Wonderful addition Smile

Cheers
 
Palbin







PostPosted: Sun Nov 29, 2009 12:49 pm Reply with quote

I don't have time to look into adding the mod to hide the actual text now. The area in question that needs edited is the ELSE part of the below code

Code:


      if (!$hideLinksFromGuests || is_admin($admin) || is_user($user)) {
         $content .= '<tr' . $class .'><td bgcolor="' . $bgcolor1 . '" class="row1"><div style="text-align: left; text-decoration: none; font-style: italic">&nbsp;&nbsp;&nbsp;<a href="forums.html?amp;file=viewforum&amp;f=' . $forum_id . '" title="' . $forum_name . '">'
               . '[' . $cat_title . ':&nbsp;' . $forum_name . ']</a><br />'
               . '&nbsp;&nbsp;&nbsp;<a href="forums.html?amp;file=viewtopic&amp;t=' . $topic_id . '" title="' . $topic_title . '">&nbsp;' . $lockTopic . $topic_title . '</a></div>'
               . '</td><td bgcolor="' . $bgcolor1 . '" class="row2">' . $topic_replies . '</td><td bgcolor="' . $bgcolor1 . '" class="row3">'
               . '<a href="forums.html?amp;file=profile&amp;mode=viewprofile&amp;u=' . $sifra . '">&nbsp;&nbsp;' . $_avtor . '&nbsp;&nbsp;</a></td><td bgcolor="' . $bgcolor1 . '" class="row2">' . $topic_views . '</td>'
               . '<td nowrap="nowrap" bgcolor="' . $bgcolor1 . '" class="row3"><font size="-2" style="font-style: italic;">&nbsp;&nbsp;' . $post_time . '&nbsp;&nbsp;</font><br />'
               . '<a href="forums.html?amp;file=profile&amp;mode=viewprofile&amp;u=' . $user_id . '">&nbsp;&nbsp;' . $_username . '&nbsp;&nbsp;</a>&nbsp;<a href="forums.html?amp;file=viewtopic&amp;p=' . $topic_last_post_id . '#' . $topic_last_post_id . '">'
               . '<img src="images/blocks/icon_minipost_new.gif" alt="" border="0" /></a></td></tr>';
      } else {
         $content .= '<tr' . $class .'><td bgcolor="' . $bgcolor1 . '" class="row1"><div style="text-align: left; text-decoration: none; font-style: italic">&nbsp;&nbsp;&nbsp;<a href="forums.html?amp;file=viewforum&amp;f=' . $forum_id . '" title="' . $forum_name . '">'
               . '[' . $cat_title . ':&nbsp;' . $forum_name . ']</a><br />'
               . '&nbsp;&nbsp;&nbsp;<a href="forums.html?amp;file=viewtopic&amp;t=' . $topic_id . '" title="' . $topic_title . '">&nbsp;' . $lockTopic . $topic_title . '</a></div>'
               . '</td><td bgcolor="' . $bgcolor1 . '" class="row2">' . $topic_replies . '</td><td bgcolor="' . $bgcolor1 . '" class="row3">' . $_avtor .'</td>'
               . '<td bgcolor="' . $bgcolor1 . '" class="row2">' . $topic_views . '</td>'
               . '<td nowrap="nowrap" bgcolor="' . $bgcolor1 . '" class="row3"><font size="-2" style="font-style: italic;">&nbsp;&nbsp;' . $post_time . '&nbsp;&nbsp;</font><br />'
               . $_username . '&nbsp;<img src="images/blocks/icon_minipost_new.gif" alt="" border="0" /></td></tr>';
      }
 
dad7732







PostPosted: Sun Nov 29, 2009 2:00 pm Reply with quote

Not in any rush here at all .. Thanks, I can wait.

Cheers
 
dad7732







PostPosted: Mon Nov 30, 2009 11:48 am Reply with quote

Went back to "FALSE" because whatever is causing the topics list to be centered is also affecting IE display to right justified on the entire block thereby pushing the right-side blocks to the right, except the block header which remains in place ok.

Also .. only happens with "guest" access, all else not affected.

BTW: Doesn't affect Gecko browsers.

Cheers
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©