Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
rogue3
Regular
Regular


Joined: Jul 02, 2009
Posts: 63

PostPosted: Sun Sep 13, 2009 7:10 am Reply with quote

I currently have one small bug I'm trying to figure out. I think I'm on the right trail, but the final answer is elluding me.

After playing around with the JReviews module, the only think I didn't like about it is that it dropped the alpha-numeric index. I liked having the option to choose reviews by letter. Anyways, I added it back in using the standard Reviews module as a template. I had to copy the function from the Reviews module into the JReviews module, rename it, and update all the necessary parts. I finally did get it all working just fine.

The only but I'm seeing is that when you click on any letter it brings up the page correctly, but the menu that appears at the top of every page is dropping the 'index' link.

Examples:

proper way showing the index menu link at the top:
Only registered users can see links on this board! Get registered or login!

alpha page dropping the link:
Only registered users can see links on this board! Get registered or login!

I think I have narrowed it down to this part in the menu function:
Code:
    if (!isset($rop) || $rop=='categ' || $rop=='search' || $rop=='TopRated' || $rop=='showcontent' || $rop=='PreviewReview' || $rop=='MostPopular' || $rop=='WriteReview' || $rop=='NewReviews' || $rop=='NewReviewsDate') {


That first part (!isset($rop) I think is the problem. I'm not sure why the index is not listed like the rest of them. Anyways, here's the whole function if anyone can shed some light...

Code:
function menu() {

    global $module_name, $admin, $rop;

    $ThemeSel = get_theme();
    if (file_exists("themes/$ThemeSel/images/jreview-logo.gif")) {
   echo '<br><center><a href="modules.php?name='.$module_name.'"><img src="themes/'.$ThemeSel.'/images/jreview-logo.gif" border="0" alt=""></a><br><br>';
    } else {
   echo '<br><center><a href="modules.php?name='.$module_name.'"><img src="modules/'.$module_name.'/images/jreview-logo.gif" border="0" alt=""></a><br><br>';
    }
    echo '<form action="modules.php?name='.$module_name.'&amp;rop=search&amp;query='.$query.'" method="post">
    <font class="content"><input type="text" size="25" name="query"> <input type="submit" value="'._SEARCH.'"></font>
    </form>';
    if (!isset($rop) || $rop=='categ' || $rop=='search' || $rop=='TopRated' || $rop=='showcontent' || $rop=='PreviewReview' || $rop=='MostPopular' || $rop=='WriteReview' || $rop=='NewReviews' || $rop=='NewReviewsDate') {
      echo '<font size="2" face="Arial, Helvetica"><a href="modules.php?name='.$module_name.'">'._REVIEWINDEX.'</a>';
    }    if (is_admin($admin))
    echo ' | <a href="modules.php?name='.$module_name.'&amp;rop=WriteReview">'._WRITEREVIEW.'</a>';
    echo ' | <a href="modules.php?name='.$module_name.'&amp;rop=NewReviews">'._NEW.'</a>';
    echo ' | <a href="modules.php?name='.$module_name.'&amp;rop=MostPopular">'._POPULAR.'</a>';
    echo ' | <a href="modules.php?name='.$module_name.'&amp;rop=TopRated">'._TOPRATED.'</a>';
    echo ' | <a href="modules.php?name='.$module_name.'&amp;rop=RandomReview">'._RANDOM.'</a></font></center>';
}


Thanks as always!
 
View user's profile Send private message
duck
Involved
Involved


Joined: Jul 03, 2006
Posts: 273

PostPosted: Sun Sep 13, 2009 7:57 am Reply with quote

Your $rop = C in the one not showing index so the Index won't show.

Not knowing if $rop has an index indicator value I cwould see as a simple solution changing this line:

Code:
if (!isset($rop) || $rop=='categ' || $rop=='search' || $rop=='TopRated' || $rop=='showcontent' || $rop=='PreviewReview' || $rop=='MostPopular' || $rop=='WriteReview' || $rop=='NewReviews' || $rop=='NewReviewsDate') {




To

Code:
if (!empty($rop)) {




Or alternatively you must add your othher $rop options like || $rop='c'
 
View user's profile Send private message
rogue3
PostPosted: Sun Sep 13, 2009 8:10 am Reply with quote

Thanks! I missed that! I just added the whole alphabet in the list. I figured that was easier than trying to take the time to find another way.

I did try the changing the code to if (!empty($rop)) { but that made the index link on all pages go away.

Thanks... and solved!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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 ©