Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-05-2002, 03:18 PM
freakyshiat freakyshiat is offline
 
Join Date: Nov 2001
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Latest post id and thread id on index page

how can I do that?

thanks...
Reply With Quote
  #2  
Old 07-05-2002, 03:50 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

there's a hack for something similar... try searching the hacks database or just the hacks list themselves

g-force2k2
Reply With Quote
  #3  
Old 07-05-2002, 05:25 PM
freakyshiat freakyshiat is offline
 
Join Date: Nov 2001
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

theres a hack that counts the posts in a thread, like what is installed at this site ; I guess I need a simple database query that will grab the latest post and thread id and output that on the index page
Reply With Quote
  #4  
Old 07-05-2002, 05:49 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

open index.php

find:

// get total posts

under it add:

PHP Code:
// +++++++ Last Post Thread ID [ Start ] +++++++
$getid=$DB_site->query('SELECT threadid FROM thread ORDER BY lastpost DESC LIMIT 1');
$id=$getid[threadid];
$lastthread="<a href=\"showthread.php?s=$session[sessionhas]&threadid=$id">$id</a>";
// +++++++ Last Post Thread ID [ End ] +++++++ 
then in the forumhome template place [php]$lastthread[/php where you want it to appear... it'll display the number like you were looking for...

i think this'll work but not positive and not sure if this is what you were looking for?

g-force2k2
Reply With Quote
  #5  
Old 07-05-2002, 06:22 PM
freakyshiat freakyshiat is offline
 
Join Date: Nov 2001
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah u have the right idea but its generating a blank index page when I add your code
Reply With Quote
  #6  
Old 07-05-2002, 06:43 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well i'll take a look and repost it in a few... you want the id number though yes? not the name? i'll test it... didn't try i yet...

g-force2k2

Edit: just saw i forgot to block out coding ;\ and you didn't get a parse error?

replace the coding i gave you with this instead:

PHP Code:
// +++++++ Last Post Thread ID [ Start ] +++++++
$getid=$DB_site->query('SELECT threadid FROM thread ORDER BY lastpost DESC LIMIT 1');
$id=$getid[threadid];
$lastthread="<a href=\"showthread.php?s=$session[sessionhas]&threadid=$id\">$id</a>";
// +++++++ Last Post Thread ID [ End ] +++++++ 
Reply With Quote
  #7  
Old 07-05-2002, 06:50 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this:

PHP Code:
$threadinfo=$DB_site->query_first("select thread.threadid, thread.title, lastpost, lastposter, post.postid from thread left join post on (post.\
threadid = thread.threadid) where forumid = 
$forumid order by postid desc limit 1;");
echo 
"<a href=\"showthread.php?s=$session[sessionhash]&postid=$threadinfo[postdid]#post$threadinfo[postid]\">$threadinfo[title]</a>"
Reply With Quote
  #8  
Old 07-05-2002, 07:02 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Zzed you forgot to block the quote at the end and i believe that Fazle wants the number not the name

g-force2k2
Reply With Quote
  #9  
Old 07-05-2002, 08:16 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LOL @ g-kforce2k2

And you spelled sessionhash as sessionhas.
Reply With Quote
  #10  
Old 07-05-2002, 08:16 PM
freakyshiat freakyshiat is offline
 
Join Date: Nov 2001
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Zzed thanks for the help, but yeah I just want the number ; the latest threadid and postid.

g-force2k2, I added the new code but when I add the $lastthread in forumhome, no number comes up ; index page doesnt show up as blank anymore, but the threadid doesnt show up either
Reply With Quote
Reply


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 12:32 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06139 seconds
  • Memory Usage 2,276KB
  • Queries Executed 12 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • postbit_imicons
  • 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