vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Last XX Posts on non-vB page (https://vborg.vbsupport.ru/showthread.php?t=12324)

AloneEagle 07-28-2002 04:50 PM

Helpppp

kaost451 08-03-2002 10:36 PM

damn has any one got this to work on vb index.php? Because I got it to work but cant call the php file ? can some one help me out?

Gutspiller 08-04-2002 01:29 AM

Does anybody know how to get this hack so that when you click on the titles it takes you to the first post in that thread and not down the page SOMEWHERE in the thread?

I know this shouldn't that hard to fix and was hoping somebody here would be kind enough to help me out on this.

Thanks for any help you can provide.

ixian 08-04-2002 04:01 PM

Quote:

Originally posted by kaost451
damn has any one got this to work on vb index.php? Because I got it to work but cant call the php file ? can some one help me out?
Yes. Firefly helped me out with this one, it's a modification to code posted a few months back here by wajones.

First, put this in your phpinclude template:

PHP Code:

function getLast10() {
    global 
$last10;
    
ob_start(); 
    include_once(
'./last10.php');
    
$last10 ob_get_contents(); 
    
ob_end_clean();
}
getLast10(); 

Now, in the last10.php script itself, comment the following out (it's near the top)
PHP Code:

require("$path/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword) or die("Can't open connection to MySQL");
mysql_select_db($dbname) or die("Can't select database"); 

Now just stick the variable $last10 wherever you want it in your templates, including the forumhome (index) and you are set.

Note that if you want to use this script in more than one place - say, one on your vb index (or it's own template, like I do) and one on your non-vb home page - you will want to use two instances of it. I renamed one last5.php and use it for my front page minus the change I outlined above.

kaost451 08-05-2002 02:40 AM

thank you so much works GREAT!!!!!!

ForKmaN 08-10-2002 11:50 AM

Hey tubb, nice hack but I'm using frames on the main site where I'm showing this. Is there a way I can make the links open in a new window?

ixian 08-10-2002 02:27 PM

Quote:

Originally posted by ForKmaN
Hey tubb, nice hack but I'm using frames on the main site where I'm showing this. Is there a way I can make the links open in a new window?
Edit the actual top10.php file. Look for the html code that links to showthread.php. It'll be regular html with some php code around it. Change it from <a href= to whatever you want: target_new, etc, just like you would normally. The only thing you want to make sure you do with PHP is escape your quotes - ie, do quotes like this: /"/

eva2000 08-10-2002 05:17 PM

i've had this hack installed for ages but now on my new server with same PHP 4.1.2 version i notice these errors in my error_log

i have 2 copies of last10.php and last10chitchat.php included on the same page i.e. http://www.eva2000.com/forum/ and 1 copy included at http://bubblegumcrisis2040.com/forum/

Code:

[Sat Aug 10 14:03:23 2002] [error] PHP Warning:  Use of undefined constant lastpost - assumed 'lastpost' in /home/username/public_html/last10.php on line 188
[Sat Aug 10 14:03:23 2002] [error] PHP Warning:  Use of undefined constant title - assumed 'title' in /home/username/public_html/last10.php on line 181
[Sat Aug 10 14:03:23 2002] [error] PHP Warning:  Use of undefined constant title - assumed 'title' in /home/username/public_html/last10.php on line 185
[Sat Aug 10 14:03:23 2002] [error] PHP Warning:  Use of undefined constant lastpost - assumed 'lastpost' in /home/username/public_html/last10.php on line 188
[Sat Aug 10 14:03:23 2002] [error] PHP Warning:  Undefined variable:  fsel in /home/username/public_html/last10chitchat.php on line 111
[Sat Aug 10 14:03:23 2002] [error] PHP Warning:  Undefined variable:  ftitle in /home/username/public_html/last10chitchat.php on line 111
[Sat Aug 10 14:03:23 2002] [error] PHP Warning:  Undefined variable:  counter in /home/username/public_html/last10chitchat.php on line 175
[Sat Aug 10 14:03:23 2002] [error] PHP Warning:  Use of undefined constant title - assumed 'title' in /home/username/public_html/last10chitchat.php on line 181
[Sat Aug 10 14:03:23 2002] [error] PHP Warning:  Use of undefined constant title - assumed 'title' in /home/username/public_html/last10chitchat.php on line 182
[Sat Aug 10 14:03:23 2002] [error] PHP Warning:  Use of undefined constant lastpost - assumed 'lastpost' in /home/username/public_html/last10chitchat.php on line 188

any ideas ?

ixian 08-10-2002 06:31 PM

When in doubt, escape your variables (i.e. put '' around them). Looks like PHP is interpreting the html as php code to me.

I've edited the hell out of this hack (got it to work with my CSS styles, got rid of queries I wasn't using, etc) and that was usually the problem I had when weird errors popped up.

If you check the html output of the script in a vaildator I bet you will find the same thing. I catch a lot of minor errors that way.

Visionray 08-10-2002 09:13 PM

Wonderful hack! Thanks! :D


All times are GMT. The time now is 05:12 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.01604 seconds
  • Memory Usage 1,750KB
  • 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
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (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