vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   last 10 posts in users profile like Wluke has (https://vborg.vbsupport.ru/showthread.php?t=32743)

SgtSling 11-27-2001 05:07 AM

?
Anyone know how this is done for 2.21?

nafae 11-28-2001 11:41 PM

i wish i did, thats a good feature

amykhar 11-29-2001 12:48 AM

It's cake.

in member.php find:

PHP Code:

 $userinfo[avatarurl]=getavatarurl($userinfo[userid]);
  if (
$userinfo[avatarurl]=="") {
    
$userinfo[avatarurl]="images/clear.gif";
  } 

add after:
PHP Code:


$postsArray
$DB_site->query("Select threadid, title from thread where  postuserid='$userid ORDER BY threadid LIMIT 10'");
if (!
$postsArray)
     
$recentPosts "none";
else {
 while (
$getRecentPosts=$DB_site->fetch_array($postsArray)) {
       
$recentPosts .="<a href='$bburl/showthread.php?threadid=" $getRecentPosts[threadid] ."'>$getRecentPosts[title]</a><br>\n";
  }


Then, simply add the $recentPosts variable in your getinfo template. Formatting is up to you. :D



NOTE: Check the variables and formatting very carefully. I modified something similar that I did on the fly and have not tested this exact code.

SgtSling 12-01-2001 04:26 AM

this appeared to work.. but for some reason it listed 100 posts.. instead of ten

Also the sort by call

For some reason it posted all the threads started by this user, instead of the last 10 posts

Can you look at this some more?
Thanks :)

amykhar 12-01-2001 02:06 PM

OOPS. I read it wrong. I thought you wanted the last 10 threads. Posts are:

Code:

Select threadid, title from post where  userid='$userid' ORDER BY postid DESC LIMIT 10'

Amy

SgtSling 12-01-2001 04:05 PM

I tired that a few times.. and this is what I got

Database error in vBulletin 2.2.1:

Invalid SQL: Select threadid, title from post where userid='2462' ORDER BY postid DESC LIMIT 10'
mysql error: You have an error in your SQL syntax near ''' at line 1

mysql error number: 1064

Date: Saturday 01st of December 2001 01:03:03 PM
Script: http://www.dlrarmy.com/forums/forums...fo&userid=2462
Referer: http://www.dlrarmy.com/forums/index.php?



I am using this code

PHP Code:

 $postsArray$DB_site->query("Select threadid, title from post where  userid='$userid' ORDER BY postid DESC LIMIT 10'");
if (!
$postsArray)
     
$recentPosts "none";
else {
 while (
$getRecentPosts=$DB_site->fetch_array($postsArray)) {
       
$recentPosts .="<a href='$bburl/showthread.php?threadid=" $getRecentPosts[threadid] ."'>$getRecentPosts[title]</a><br>\n";
  }



amykhar 12-01-2001 04:22 PM

Let me get back to you on this one. The version of my board didn't have to worry about viewing permissions, etc. because I restricted it to a given set of forums.

Amy

SgtSling 12-01-2001 04:49 PM

thanks!

Please do!

amykhar 12-01-2001 05:59 PM

<a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=32852" target="_blank">https://vborg.vbsupport.ru/showt...threadid=32852</a>


All times are GMT. The time now is 07:10 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.01127 seconds
  • Memory Usage 1,739KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete