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

Reply
 
Thread Tools Display Modes
  #11  
Old 05-12-2005, 11:30 AM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did.. Forum 35..

Quote:
/*
// Example of how to include a seperate file:

ob_start();
include('yourheader.html');
$your_code = ob_get_contents();
ob_end_clean();

// Now place a reference to $your_code where you want the resulting HTML to be displayed.
// This will most likely be the header or footer template.
*/
$getnews = $DB_site->query_first("SELECT threadid, title ".TABLE_PREFIX."thread WHERE forumid=35 ORDER BY lastpost DESC LIMIT 1");
Gives:

Quote:
Database error in vBulletin 3.0.4:

Invalid SQL: SELECT threadid, title thread WHERE forumid=35 ORDER BY lastpost DESC LIMIT 1
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE forumid=35 ORDER BY lastpost DESC LIMIT 1' at line 1

mysql error number: 1064

Date: Thursday 12th of May 2005 02:30:33 PM
Script: http://www.antispywareoffensief.nl/f...e&pp=60&page=1
Referer: http://www.antispywareoffensief.nl/f...e&pp=60&page=1
Username: Admin
IP Address: *
Reply With Quote
  #12  
Old 05-12-2005, 11:41 AM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="https://vborg.vbsupport.ru/showpost.php?p=652555&postcount=6" target="_blank">Sorry try the code again</a>
Reply With Quote
  #13  
Old 05-12-2005, 11:45 AM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Whaha, I will. Hang on a sec .

http://www.antispywareoffensief.nl/forum/index.php?

(and with this one, can I select more forums? (I dont need that currently; just interested)

THANKS ALOT!

Uuuhm.. I have another little question. Would this format be possible:


Latest news: TOPICTITLE (date - time)

"Latest News: 'Thanks cinq (12-05-2005; 14:55)'"

?
Reply With Quote
  #14  
Old 05-12-2005, 11:54 AM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great

Yes you can, just use this :

PHP Code:
$getnews $DB_site->query_first("SELECT threadid, title FROM ".TABLE_PREFIX."thread WHERE (forumid=X OR forumid=X OR forumid=X) ORDER BY lastpost DESC LIMIT 1"); 
Note the OR forumid=X portions. Just add more if you need to and replace the Xs with the respective forumids of those forums you want to check.
Reply With Quote
  #15  
Old 05-12-2005, 11:58 AM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cinq
Great

Yes you can, just use this :

PHP Code:
$getnews $DB_site->query_first("SELECT threadid, title FROM ".TABLE_PREFIX."thread WHERE (forumid=X OR forumid=X OR forumid=X) ORDER BY lastpost DESC LIMIT 1"); 
Note the OR forumid=X portions. Just add more if you need to and replace the Xs with the respective forumids of those forums you want to check.
Coool! Thx!

And my Q about date time? Is that much more work?
Reply With Quote
  #16  
Old 05-12-2005, 12:17 PM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$getnews $DB_site->query_first("SELECT threadid, title, lastpost FROM ".TABLE_PREFIX."thread WHERE (forumid=X OR forumid=X OR forumid=X) ORDER BY lastpost DESC LIMIT 1"); 
$lastpostdateline vbdate($vboptions['dateformat'],$getnews['lastpost'],true); 
Forumhome template put this :

Code:
Latest news: <a href="showthread.php?t=$getnews[threadid]">$getnews[title]</a> - $lastpostdateline
Reply With Quote
  #17  
Old 05-12-2005, 12:52 PM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm... You changed something.

title FROM ".TABLE_PREFIX.
==>
title, lastpost FROM ".TABLE_PREFIX.


Why did you do that?

http://www.antispywareoffensief.nl/forum/index.php

YOU MADE AN EAGLE HAPPY!


Thank you so much! If there's something I can do for you call me!
Reply With Quote
  #18  
Old 05-12-2005, 12:56 PM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That is to capture last post datetime for that thread
Reply With Quote
  #19  
Old 05-12-2005, 01:20 PM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cinq
That is to capture last post datetime for that thread
Ok.. But when I have the following situation:

I post new thread (1) 3 PM
someone replys to that one 3.5 PM
I post new thread (2) 4 PM
someone replys to first one 4.5 PM


Thread 1 will be displayed at the index, isnt it?
Reply With Quote
  #20  
Old 05-13-2005, 08:16 PM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it possible to look only at the post date of the FIRST post?

Because when people now react on a two day old post it shows up on the index and it looks like a recent post..
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 09:37 AM.


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.03958 seconds
  • Memory Usage 2,269KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_code
  • (3)bbcode_php
  • (4)bbcode_quote
  • (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