Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-18-2005, 09:25 PM
DGTLMIK DGTLMIK is offline
 
Join Date: Feb 2005
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Profile Picture in Postbit

In an attempt to get the Profile Picture to be displayed in a User's Post, I copied:
Code:
<if condition="$show['profilepic']">
<td valign="top" align="$stylevar[right]" rowspan="2">
<img src="image.php?u=$userinfo[userid]&amp;type=profile&amp;dateline=$userinfo[profilepicdateline]" alt="<phrase 1="$userinfo[username]">$vbphrase[xs_picture]</phrase>" border="0" style="border:1px solid $stylevar[tborder_bgcolor]" />
</td>
</if>
from the 'MEMBERINFO' Template into the 'postbit_legacy' Template but the Profile Picture was not displayed.

Then, I removed the 'IF' Statement, '<TD>' Tags, and 'alt=' info ending up with:
Code:
<img src="image.php?u=$userinfo[userid]&amp;type=profile&amp;dateline=$userinfo[profilepicdateline]" alt="" border="0" style="border:1px solid $stylevar[tborder_bgcolor]" />
Doing so does display the Profile Picture in a User's Post; however, if the Profile Picture is either deleted or changed to another one, the same Profile Picture is still displayed in that User's Post. An investigation revealed that the 'dateline' is not being included in the 'img src' URL. So, if I go to that User?s Profile, Right-Click on their, now changed, Profile Picture, which is displayed correctly, select Properties and replace '$userinfo[profilepicdateline]' with that 'dateline number', then the new image is displayed properly in the User?s Post.

What am I missing?
Reply With Quote
  #2  
Old 06-20-2005, 04:11 PM
DGTLMIK DGTLMIK is offline
 
Join Date: Feb 2005
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump...
Reply With Quote
  #3  
Old 06-20-2005, 05:24 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wonder why it does display anything ... it should be $post[userid].
However, if you want the dateline in there you must modify the $posts/$cacheposts queries in showthread.php to make a left join on table customprofilepic and get the dateline from this table.
Furthermore, you should add an if to avoid image.php also being called for users that do not even have profile pictures.
Reply With Quote
  #4  
Old 06-20-2005, 08:00 PM
DGTLMIK DGTLMIK is offline
 
Join Date: Feb 2005
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
I wonder why it does display anything ... it should be $post[userid].
I changed it as you indicated and cleaned it up some more ending up with:

Code:
<img src="image.php?u=$post[userid]&amp;type=profile&amp;dateline=$userinfo[profilepicdateline]" alt="" border="0" />
Quote:
Originally Posted by KirbyDE
However, if you want the dateline in there you must modify the $posts/$cacheposts queries in showthread.php to make a left join on table customprofilepic and get the dateline from this table.
Furthermore, you should add an if to avoid image.php also being called for users that do not even have profile pictures.
Could you help me out with this part? I am not familiar enough with PHP to know how to perform these two steps. Thanks in advance.
Reply With Quote
  #5  
Old 06-20-2005, 10:00 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is a Thread about displaying an icon in postbit if a user has a profile picture somewhere - take a look at it.
Reply With Quote
  #6  
Old 06-21-2005, 02:11 PM
DGTLMIK DGTLMIK is offline
 
Join Date: Feb 2005
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
There is a Thread about displaying an icon in postbit if a user has a profile picture somewhere - take a look at it.
I added the 2 lines from that Thread to both '$posts' and '$cacheposts' in 'showthread.php' and the Profile Pic is displayed in all Display Modes and goes away when I delete the Profile Picture from the User Control Panel as it should. Now, the only thing left is, what code do I need to add to 'showthread.php' to grab the 'customprofilepic.dateline' ?
Reply With Quote
  #7  
Old 06-21-2005, 02:13 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

customprofilepic.dateline AS picdateline or smth. like this
Reply With Quote
  #8  
Old 06-21-2005, 02:19 PM
DGTLMIK DGTLMIK is offline
 
Join Date: Feb 2005
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I'm still a Noobie , where in here do I put that?

PHP Code:
    $posts $DB_site->query("
        SELECT
            post.*, post.username AS postusername, post.ipaddress AS ip,
            user.*, userfield.*, usertextfield.*,
            " 
iif($forum['allowicons'], 'icon.title as icontitle, icon.iconpath,') . "
            " 
iif($vboptions['avatarenabled'], 'avatar.avatarpath, NOT ISNULL(customavatar.avatardata) AS hascustomavatar, customavatar.dateline AS avatardateline,') . "
            " 
iif($vboptions['reputationenable'], 'level,') . "
            " 
iif(!$deljoin'NOT ISNULL(deletionlog.primaryid) AS isdeleted, deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason,') . "
            editlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline,
            editlog.reason AS edit_reason,
            post_parsed.pagetext_html, post_parsed.hasimages,
            NOT ISNULL(customprofilepic.userid) AS haspic,
            IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
            " 
iif(!($permissions['genericpermissions'] & CANSEEHIDDENCUSTOMFIELDS), $datastore['hidprofilecache']) . "
        FROM " 
TABLE_PREFIX "post AS post
        LEFT JOIN " 
TABLE_PREFIX "user AS user ON(user.userid = post.userid)
        LEFT JOIN " 
TABLE_PREFIX "userfield AS userfield ON(userfield.userid = user.userid)
        LEFT JOIN " 
TABLE_PREFIX "usertextfield AS usertextfield ON(usertextfield.userid = user.userid)
        " 
iif($forum['allowicons'], "LEFT JOIN " TABLE_PREFIX "icon AS icon ON(icon.iconid = post.iconid)") . "
        " 
iif($vboptions['avatarenabled'], "LEFT JOIN " TABLE_PREFIX "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " TABLE_PREFIX "customavatar AS customavatar ON(customavatar.userid = user.userid)") .
            
iif($vboptions['reputationenable'], " LEFT JOIN " TABLE_PREFIX "reputationlevel AS reputationlevel ON(user.reputationlevelid = reputationlevel.reputationlevelid)") . "
        " 
iif(!$deljoin"LEFT JOIN " TABLE_PREFIX "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND deletionlog.type = 'post')") . "
        LEFT JOIN " 
TABLE_PREFIX "editlog AS editlog ON(editlog.postid = post.postid)
        LEFT JOIN " 
TABLE_PREFIX "post_parsed AS post_parsed ON(post_parsed.postid = post.postid)
        LEFT JOIN " 
TABLE_PREFIX "customprofilepic AS customprofilepic ON(customprofilepic.userid = post.userid)
        WHERE 
$postids
        ORDER BY dateline 
$postorder
    "
); 
Reply With Quote
  #9  
Old 06-21-2005, 02:25 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the $posts and $cacheposts queries somewhere between SELECT and FROM, for example after NOT ISNULL(customprofilepic.userid) AS haspic
To learn more about queries I suggest to read the mySQL manual @ http://www.mysql.com
Reply With Quote
  #10  
Old 06-21-2005, 02:49 PM
DGTLMIK DGTLMIK is offline
 
Join Date: Feb 2005
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
In the $posts and $cacheposts queries somewhere between SELECT and FROM, for example after NOT ISNULL(customprofilepic.userid) AS haspic
Thanks for the hint:

PHP Code:
NOT ISNULL(customprofilepic.userid) AS haspiccustomprofilepic.dateline AS profilepicdateline
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:08 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.04471 seconds
  • Memory Usage 2,290KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (2)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete