Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 01-01-2001 Last Update: Never Installs: 0
 
No support by the author.

first of all my 'beginning' code might be a bit different, my board is really hacked up. anyways,...

to get a 'Next Page >' button in your multi-page threads, so people dont need to remember what page they're on:
in showthread.php replace
Code:
  while ($curpage++<$totalpages) {

    if (($curpage<$pagenumber-$pagenavpages or $curpage>$pagenumber+$pagenavpages) and $pagenavpages!=0) {
      if ($curpage==1) {
        $pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>&lt;&lt; First Page</font></a>&nbsp;&nbsp; ...&nbsp;&nbsp;";
      }
      if ($curpage==$totalpages) {
        $pagenav.=" ...&nbsp;&nbsp;<a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Last Page &gt;&gt;</font></a>&nbsp;&nbsp;";
      }
    } else {
      if ($curpage==$pagenumber) {
        $pagenav.=" <font color=\"#afa3c5\" class=thtcolor>$curpage</font>&nbsp;&nbsp;";
      } else {
        $pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>$curpage</font></a>&nbsp;&nbsp;";
      }
    }
  }
} else {
with
Code:
  while ($curpage++<$totalpages) {

    if (($curpage<$pagenumber-$pagenavpages or $curpage>$pagenumber+$pagenavpages) and $pagenavpages!=0) {
      if ($curpage==1) {
        $pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>&lt;&lt; First Page</font></a>&nbsp;&nbsp; ...&nbsp;&nbsp;";
      }
      if ($curpage==$totalpages) {
		$twrat_nextpage = ($pagenumber)+1;
        $pagenav.=" ...&nbsp;&nbsp; <a href=\"showthread.php?threadid=$threadid&pagenumber=$twrat_nextpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Next Page &gt;</font></a>&nbsp;&nbsp;<a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Last Page &gt;&gt;</font></a>&nbsp;&nbsp;";
      }
    } else {
      if ($curpage==$pagenumber) {
        $pagenav.=" <font color=\"#afa3c5\" class=thtcolor>$curpage</font>&nbsp;&nbsp;";
      } else {
        $pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumber=$curpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>$curpage</font></a>&nbsp;&nbsp;";
      }
    }
  }
$twrat_nextpage = ($pagenumber)+1;
$pagenav.="&nbsp;&nbsp; <a href=\"showthread.php?threadid=$threadid&pagenumber=$twrat_nextpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Next Page &gt;</font></a>&nbsp;&nbsp;";

} else {
excuse the weird var names, i prefix my stuff generally w/ tw_ or twrat_ so i can find it easier before i go back and comment it

to make your template.php create instantly useable templates from the form (instead of having to go into global.php and register them) open /admin/template.php and find

Code:
  $DB_site->query("INSERT INTO template (templateid,title,template) VALUES (NULL,'".addslashes("$title")."','".addslashes("$template")."')");
under it add

Code:
# added template code
# echo "title is $title <br>"; # debugging
$filename = "rattemp.php";
$str = '<?php eval("\$'; 
$str .= $title; 
$str .= ' = \"".gettemplate("';
$str .= $title;
$str .= '")."\";"); ?>';
$fp=fopen($filename, 'a+'); 
fwrite($fp,"$str \n"); 
fclose($fp);

# end
then open up global.php and find
Code:
eval("\$fivelinks = \"".gettemplate("fivelinks")."\";");
and under it add
Code:
require ("admin/rattemp.php");
now create an empty file called /admin/rattemp.php and upload it, make sure its CHMOD-ed to 666, and you're set. also note if you delete custom templates, this wont remove the reference from the rattemp.php file, you'll have to do that manually, but i did this for my design guy who isnt really one to go trekking through code when he wants to make a template

anyways, thats all stuff ive been meaning to do for 3 months and never got around to it, so i figured maybe i'd share it

also im not really a mega-php programmer, my bag is perl, so if you find my code is weird (or just plain bad) thats why

[Edited by Ratorasniki on 01-01-2001 at 07:45 PM]

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 01-02-2001, 06:18 PM
Guest
 
Posts: n/a
Default

thanks freddie!
Reply With Quote
  #13  
Old 01-02-2001, 08:09 PM
Guest
 
Posts: n/a
Default

Code:
$twrat_prevpage = ($pagenumber)-1;
$twrat_nextpage = ($pagenumber)+1;
if ($pagenumber != 1) {
  $pagenav.="<a href=\"showthread.php?threadid=$threadid&pagenumber=$twrat_prevpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>&lt; Previous Page &gt;</font></a>&nbsp;&nbsp;"; 
}
if ($pagenumber != $totalpages) {
  $pagenav.="&nbsp;&nbsp;<a href=\"showthread.php?threadid=$threadid&pagenumber=$twrat_nextpage".iif($perpage==$maxposts,"","&perpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Next Page &gt; &gt;</font></a>&nbsp;&nbsp;"; 
}
put that between:

eval("\$pagenav = \"".gettemplate("showthread_numpages")."\";");

and

$curpage=0;
while ($curpage++<$totalpages) {
Reply With Quote
  #14  
Old 01-03-2001, 03:43 AM
Guest
 
Posts: n/a
Default

you were close but I already find it out..
the full code should be:
Quote:
eval("\$pagenav = \"".gettemplate("showthread_numpages")."\";");
$twrat_prevpage = ($pagenumber)-1;
$twrat_nextpage = ($pagenumber)+1;
if ($pagenumber != 1) {
$pagenav.="<a href=\"showthread.php?threadid=$threadid&pagenumbe r=$twrat_prevpage".iif($perpage==$maxposts,"","&pe rpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>&lt; Previous Page</font></a>&nbsp;&nbsp;";
}
$curpage=0;
while ($curpage++<$totalpages) {

if (($curpage<$pagenumber-$pagenavpages or $curpage>$pagenumber+$pagenavpages) and $pagenavpages!=0) {
if ($curpage==1) {
$pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumbe r=$curpage".iif($perpage==$maxposts,"","&perpage=$ perpage")."\"><font color=\"#afa3c5\" class=thtcolor>&lt;&lt; First Page</font></a>&nbsp;&nbsp; ...&nbsp;&nbsp;";
}
if ($curpage==$totalpages) {
$pagenav.=" ...&nbsp;&nbsp;<a href=\"showthread.php?threadid=$threadid&pagenumbe r=$curpage".iif($perpage==$maxposts,"","&perpage=$ perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Last Page &gt;&gt;</font></a>&nbsp;&nbsp;";
}
} else {
if ($curpage==$pagenumber) {
$pagenav.=" <font color=\"#afa3c5\" class=thtcolor>$curpage</font>&nbsp;&nbsp;";
} else {
$pagenav.=" <a href=\"showthread.php?threadid=$threadid&pagenumbe r=$curpage".iif($perpage==$maxposts,"","&perpage=$ perpage")."\"><font color=\"#afa3c5\" class=thtcolor>$curpage</font></a>&nbsp;&nbsp;";
}
}
}
if ($pagenumber != $totalpages) {
$pagenav.="&nbsp;&nbsp;<a href=\"showthread.php?threadid=$threadid&pagenumbe r=$twrat_nextpage".iif($perpage==$maxposts,"","&pe rpage=$perpage")."\"><font color=\"#afa3c5\" class=thtcolor>Next Page &gt;</font></a>&nbsp;&nbsp;";
}
} else {
that works great.


[Edited by Scaramanga_gold on 01-03-2001 at 07:12 AM]
Reply With Quote
  #15  
Old 01-03-2001, 01:09 PM
Guest
 
Posts: n/a
Default

Glad you figured it out. Now you are on your way to becoming a successful vBulletin Hacker and have a sense of accomplishment far greater than a mere copying and pasting could have given you.

Congratulations.
Reply With Quote
  #16  
Old 01-03-2001, 03:01 PM
Guest
 
Posts: n/a
Default

Well, I dont think Ill become the greatest vb hacker of all times but I might fix some problems with other ppl work, that because I know just NOTHING about PHP but i have a good logic and I know C++.

thanks, and have a happy new year.
Reply With Quote
  #17  
Old 01-03-2001, 03:04 PM
Guest
 
Posts: n/a
Default

All it takes is knowing C/C++ and you are 75% there.
Reply With Quote
  #18  
Old 01-03-2001, 08:17 PM
Guest
 
Posts: n/a
Default

hey, i came from Perl :P

i still like it better then c/c++, although to be fair i only know enough c/c++ to do what needs to be done, so to speak. im starting to like php but i need to work with it a lot more, i think before i can really pass judgement. still, i find myself using perl for most anything besides the vb on my site.

to be honest im surprised that worked for anyone else, like i said im a php newbie, and my version of vb is so hacked up its barely recognizable from the code standpoint. we ran a bunch of optimizations, added 'real' private forums (w/ passwords, etc), and all sorts of neato stuff. anyways, im glad it worked for anyone who tried it.
Reply With Quote
  #19  
Old 01-03-2001, 09:59 PM
Guest
 
Posts: n/a
Default

My forums are really private. Those without access can't even see them and I control all access to them.
Reply With Quote
  #20  
Old 01-03-2001, 10:06 PM
Guest
 
Posts: n/a
Default

sure they cant see them, but by default (in the version i have installed, which is like 1.1.3 i think - im scared to upgrade w/ all my hacked up shiznit) you can change the forumid and get in w/ no checks.
Reply With Quote
  #21  
Old 01-03-2001, 10:15 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by Ratorasniki
you can change the forumid and get in w/ no checks.
Are you sure you weren't actually logged in?

[Edited by Ed Sullivan on 01-03-2001 at 07:22 PM]
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:28 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04561 seconds
  • Memory Usage 2,287KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete