vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Display Last X Posts on front page (https://vborg.vbsupport.ru/showthread.php?t=79228)

TCattitude 04-02-2005 11:01 PM

I saw this hack-mod once.
Is for a non-VB page, that's why it get all that data directly from DB.
And that's why it wont work if you put it direct into a vb-page (in a template for example)

RonHiler 04-02-2005 11:28 PM

Ah, sorry 'bout that. I forgot to mention about prefixes. Tnguy3n is correct, you have to substitute your own database prefix (if any). My prefix for my database tables is "vb_". If you don't use a prefix, change these lines as follows:
$result = mysql_query("SELECT postid FROM vb_post WHERE visible=1");
to
$result = mysql_query("SELECT postid FROM post WHERE visible=1");

$post_sql = mysql_query("SELECT postid,threadid,username,userid,dateline FROM vb_post WHERE visible=1 ORDER BY postid DESC $limited");
to
$post_sql = mysql_query("SELECT postid,threadid,username,userid,dateline FROM post WHERE visible=1 ORDER BY postid DESC $limited");

and

$thread_sql = mysql_query("SELECT title FROM vb_thread WHERE threadid=$tid");
to
$thread_sql = mysql_query("SELECT title FROM thread WHERE threadid=$tid");

(pretty much just what tn said).

Quote:

will this show posts of "secret board" ?
I don't *think* so (the "WHERE visible=1" should prevent non-public posts from showing up, if I understand that database entry correctly), but I haven't actually tested it. Let me know if it doesn't work as intended, and I'll see what I can do. I'll work on the code as well so there's an entry in the "modifiables" section for the database prefix so it's more obvious.

Ron

Selene 04-02-2005 11:50 PM

ok thxn its working now, how can i change bg color and stuff?

Selene 04-03-2005 01:06 AM

i have tried to use it as a postnuke block, so the block on right side displays the latest forums posts.
but it gives error. the page is working fine from direct url, but when i use it as block it doesnt work. Any suggetions

RonHiler 04-03-2005 01:51 AM

Updated the code to make the database prefix issue more user friendly.

Selene: What error are you getting with postnuke?

To answer your question about the table color, there's a few ways you can change it. To change the background color, put an entry in the tr field. For the font color, unfortunately, because we are dealing with static text, links, and (possibly) visited links, it's a bit more complex. Also, I've set it up so that you can control the fonts for each field individually, so we have three different fields to deal with (because I have < font > in three seperate places, I don't think you can set the three entries globally, as the < /font > would kill them, so you have to do them one at a time, if I'm not mistaken).

So let's say you wanted black background with white text, the resulting output line would look like this:

echo "<tr bgcolor='black'><td><font size='2' color='white' link='white' vlink='white'>$date2<BR></font><font size='2' color='white' link='white' vlink='white'><a href=\"$forum_url/showthread.php?p=$pid#post$pid\">$title</a></font><font size='2' color='white' link='white' vlink='white'><i><BR><a href=\"$forum_url/member.php?userid=$userid\">$poster</a></i></font></td></tr>";

Ugly, I know. But it should work :) I haven't tested it though, so I make no promises. You could shorten it a little bit by being more specific for particular lines (for instance, we know the first line (the date) is static text, so there's really no need to set the link or vlink colors there, I'm doing it just for consistency sake).

Hope that helps.

Ron

Selene 04-03-2005 01:54 AM

Hi Ron, gr8 ! i will try that out so thats sorted! well its just when i try to make the latest forums page open as block using php in postnuke i get error:

u can check http://67.19.62.198/post/

i also opened a thread on postnuke site : http://forums.postnuke.com/index.php...topic&p=154711


Otherwise gr8 and useful hack! and good work :)

hendri 04-03-2005 09:12 AM

Quote:

Originally Posted by Selene
Hi Ron, gr8 ! i will try that out so thats sorted! well its just when i try to make the latest forums page open as block using php in postnuke i get error:

u can check http://67.19.62.198/post/

i also opened a thread on postnuke site : http://forums.postnuke.com/index.php...topic&p=154711


Otherwise gr8 and useful hack! and good work :)

done no problem already !

hendri 04-03-2005 10:05 AM

Quote:

Originally Posted by hendri
done no problem already !

www.aroclubindonesia.com

arowana club indonesia !

Selene 04-03-2005 11:43 AM

hendri i still cant get it to work with postnuke as block. can u see the url in my previous post and check the error. wud be nice if I can get it to work in postnuke

jugo 04-03-2005 06:31 PM

I've had something like this on my site for a while: http://www.s3squad.com

Check these links out:
https://vborg.vbsupport.ru/showthread.php?t=62823
https://vborg.vbsupport.ru/showthread.php?t=62624


But noine that use the built in vB functions. Would be nice.


All times are GMT. The time now is 02:16 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.01091 seconds
  • Memory Usage 1,740KB
  • 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
  • (3)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