vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Latest news on the index (invision function) (https://vborg.vbsupport.ru/showthread.php?t=81366)

Eagle Creek 05-12-2005 11:30 AM

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: *
:(

cinq 05-12-2005 11:41 AM

<a href="https://vborg.vbsupport.ru/showpost.php?p=652555&postcount=6" target="_blank">Sorry try the code again</a>

Eagle Creek 05-12-2005 11:45 AM

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)'"

?

cinq 05-12-2005 11:54 AM

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.

Eagle Creek 05-12-2005 11:58 AM

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?

cinq 05-12-2005 12:17 PM

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

Eagle Creek 05-12-2005 12:52 PM

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!

cinq 05-12-2005 12:56 PM

That is to capture last post datetime for that thread :)

Eagle Creek 05-12-2005 01:20 PM

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?

Eagle Creek 05-13-2005 08:16 PM

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..


All times are GMT. The time now is 03:53 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.01058 seconds
  • Memory Usage 1,749KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete