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)

03-27-2001 04:07 PM

tubedogg:

Do you think that you could write this so that you could get the message that was posted included?

Parker

03-27-2001 06:29 PM

Whoa great man Thanks that's very useful!
Usually on your site you will have some chit-chat forums that you don't want to be displayed on the main page ;)
Thanks a lot it's just what I needed!

03-28-2001 06:50 AM

I have released a new version with Parker's suggestion and a couple other new features. It is version 0.1.0. Enjoy! :)

See the first post in this thread to download it.

03-28-2001 07:02 AM

Great display of info about the hack, tubedogg. File info, instructions, screen shots, a .txt file for easy cut/paste, etc. We should make this a template of what all hack release threads should look like.

03-28-2001 07:05 AM

aw shucks. :) Thanks!

03-29-2001 07:50 AM

tubedogg:

I LOVE this hack.

I added this to the last10.php file to parse the bbcode in the messages that are displayed.

First off I added:

require('./global.php');

then I changed

$lastpost2 = $lastpost1[pagetext];

to

$lastpost2 = bbcodeparse($lastpost1[pagetext]);

and

lastpostshort = $lastpost2;

to

$lastpostshort = bbcodeparse($lastpost2);

This enables the vBcode to parse and show up in the displayed message. HTML (if you allow it) comes through just fine.

Also, I found if you add the global.php require in the top10.php file you don't need to use the
require("$path/config.php"); line.

Thanks again for the great hack.

Parker

03-29-2001 07:58 AM

Quote:

Originally posted by Parker Clack
I LOVE this hack.
Thanks! :)

Quote:

Originally posted by Parker Clack
...then I changed $lastpost2 = $lastpost1[pagetext]; to $lastpost2 = bbcodeparse($lastpost1[pagetext]);
That's a good idea! However, I wouldn't parse it right there, because then you're parsing it twice if the post is less than $lplen characters. I would parse it within the if()...else() block, because then you are only parsing it once - change
PHP Code:

    if ($query0 != "" && strlen($lastpost2) > $lplen) {
        
$lastpostshort substr($lastpost2,0,$lplen);
        
$lastpostshort .= "...";
    } else {
        
$lastpostshort $lastpost2;
    } 

to
PHP Code:

    if ($query0 != "" && strlen($lastpost2) > $lplen) {
        
$lastpostshort substr($lastpost2,0,$lplen);
        
$lastpostshort .= "...";
        
$lastpostshort bbcodeparse($lastpostshort);
    } else {
        
$lastpostshort bbcodeparse($lastpost2);
    } 

Quote:

Originally posted by Parker Clack
Also, I found if you add the global.php require in the top10.php file you don't need to use the
require("$path/config.php"); line.

Correct, because global.php calls config.php.

Quote:

Originally posted by Parker Clack
Thanks again for the great hack.
You're welcome! :) I'll add your bbcodeparsing idea to it and rerelease it pronto - as soon as I finish this other hack I'm working on...;)

03-29-2001 08:23 AM

Quote:

Originally posted by Parker Clack
tubedogg:

I LOVE this hack.

I added this to the last10.php file to parse the bbcode in the messages that are displayed.

First off I added:

require('./global.php');

then I changed

$lastpost2 = $lastpost1[pagetext];

to

$lastpost2 = bbcodeparse($lastpost1[pagetext]);

and

lastpostshort = $lastpost2;

to

$lastpostshort = bbcodeparse($lastpost2);


This enables the vBcode to parse and show up in the displayed message. HTML (if you allow it) comes through just fine.

Also, I found if you add the global.php require in the top10.php file you don't need to use the
require("$path/config.php"); line.

Thanks again for the great hack.

Parker

Parker,

I like your additions, but they only work if the person viewing the page has already visited your forum in the past. If they have not they get the dreaded error:

Warning: Cannot add header information - headers already sent by (output started at /usr/local/etc/httpd/htdocs/sbw/forum/last10.php:2)
in /usr/local/etc/httpd/htdocs/sbw/forum/admin/functions.php on line 1090

I like Tube's hack, but until it parses VBCode without the error above for new users I don't think a lot of people will be able to use it.

03-29-2001 08:26 AM

Ah. I did not know that. Scrap that plan. Sorry guys! :) I won't be adding that to it after all.

03-29-2001 08:33 AM

Hmm... So if they are new members that just signed up on the board or they are just visiting and they aren't registered members they will get this error if they click on the link to this page, or what?

Parker


All times are GMT. The time now is 04:11 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.01477 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
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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