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 X Posts In Profile (https://vborg.vbsupport.ru/showthread.php?t=41743)

Aaron1 01-20-2003 07:56 AM

Solved myself!

Right after this:

$posttitle=$getlastpost[title];

ADD this:

if (strlen($getlastpost[title]) > 40) {
$posttitle = substr($getlastpost[title], 0, 37) . '...';
}

It works on my forum!

007 02-09-2003 05:38 PM

does anybody know how to get this working with maybe an if/then/else statement?

here's what i want to do. i want it to instead of ALWAYS showing the thread title that was posted in, i want it to be something like

if thread title exists, it will use that UNLESS there is also an individual post subject that someone has manually entered along the line, then it would use that? see what I mean? thanks.

kino 03-06-2003 10:40 PM

Does anyone know what I did? All I did was simple copy and paste, but it gives me errors. See what I mean:

PHP Code:

Parse errorparse errorexpecting `']'' in /home/gorzekc/public_html/kino/forums/member.php(1413) : eval()'d code on line 86 


Xyphen 03-09-2003 06:17 PM

Works fine on vB2.3.0 except if user has made no post then it doesn't display the No Posts Made template.. I am also using your Hide Un-entered fields..

Boofo 03-09-2003 06:45 PM

Quote:

Originally posted by 006
does anybody know how to get this working with maybe an if/then/else statement?

here's what i want to do. i want it to instead of ALWAYS showing the thread title that was posted in, i want it to be something like

if thread title exists, it will use that UNLESS there is also an individual post subject that someone has manually entered along the line, then it would use that? see what I mean? thanks.

Just add:

PHP Code:

        if ($posttitle == "") {
        
$posttitle "Re: $threadtitle";
        } else {
        
$posttitle "$posttitle";
        } 

Above:

PHP Code:

        $postctr++; 

You'll also have to change the query to this:

PHP Code:

    $getlastposts=$DB_site->query("SELECT thread.title AS threadtitle,thread.threadid,thread.forumid,post.title AS posttitle,post.postid,post.dateline,post.userid,post.visible FROM thread,post WHERE thread.threadid=post.threadid AND post.userid=$userinfo[userid] AND post.visible=1 ORDER BY post.dateline DESC"); 

And add this:

PHP Code:

        $threadtitle=$getlastpost[threadtitle];
        
$threadtitle=censortext($threadtitle);
        
$threadtitle=htmlspecialchars($threadtitle);
        
$threadurl="showthread.php?s=$session[sessionhash]&threadid=$getlastpost[threadid]\" title=\"Go to first post"

Above this:

PHP Code:

        $posttitle=$getlastpost[posttitle]; 



All times are GMT. The time now is 12:51 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.01111 seconds
  • Memory Usage 1,735KB
  • 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
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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