vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   custom profile fields in printable version...Will Pay! (https://vborg.vbsupport.ru/showthread.php?t=66169)

btappan 06-14-2004 06:47 PM

custom profile fields in printable version...Will Pay!
 
does anybody know how to get the same custom user profile fields i have in my postbit to show in the printable version? I use this:

<if condition="$post[fieldX]"><div align="left">$post[fieldX]</div></if>

in my postbit and it works fine, however when put in the printthreadbit template, it does nothing. The team over at VB.com said it will not work that way either, and to try asking here. I am desperate to do this as 90 % of my users print threads for use as notes and i have contact info for the user show up in these fields that has to be on there somehow. thanks ahead for your help.

I'll paypal or mail a check for $30 to the first person with a working soloution!

btappan 06-15-2004 01:48 PM

any takers?

Boofo 06-15-2004 02:46 PM

Try this:

HTML Code:

<if condition="$post['fieldX']"><div align="left">$post[fieldX]</div></if>
and let me know if that works. ;)

Zachery 06-15-2004 02:53 PM

Quote:

Originally Posted by Boofo
Try this:

HTML Code:

<if condition="$post['fieldX']"><div align="left">$post[fieldX]</div></if>
and let me know if that works. ;)

It doesnt, the data is not there to be called.



line 844 has the massive query to get the info, but i cant make any sense of it. for showthread.

Boofo 06-15-2004 03:30 PM

Quote:

Originally Posted by btappan
does anybody know how to get the same custom user profile fields i have in my postbit to show in the printable version? I use this:

<if condition="$post[fieldX]"><div align="left">$post[fieldX]</div></if>

in my postbit and it works fine, however when put in the printthreadbit template, it does nothing. The team over at VB.com said it will not work that way either, and to try asking here. I am desperate to do this as 90 % of my users print threads for use as notes and i have contact info for the user show up in these fields that has to be on there somehow. thanks ahead for your help.

I'll paypal or mail a check for $30 to the first person with a working soloution!

Ok, I got it. Thanks to Zach for finding the query I needed to edit.

In the printthread.php file

Find:

PHP Code:

$posts $DB_site->query("
SELECT post.*,post.username AS postusername,user.username
FROM " 
TABLE_PREFIX "post AS post
LEFT JOIN " 
TABLE_PREFIX "user AS user ON(user.userid = post.userid)
LEFT JOIN " 
TABLE_PREFIX "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
WHERE post.threadid=
$threadid AND post.visible=1 AND deletionlog.primaryid IS NULL
ORDER BY dateline 
$postorder
LIMIT 
$startat$perpage
"
); 

and replace it with:

PHP Code:

$posts $DB_site->query("
SELECT post.*,post.username AS postusername,user.username,userfield.*
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 "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
WHERE post.threadid=
$threadid AND post.visible=1 AND deletionlog.primaryid IS NULL
ORDER BY dateline 
$postorder
LIMIT 
$startat$perpage
"
); 

and voila! Your if condition should now work. ;)

vbmechanic 06-15-2004 03:31 PM

Open printthread.php, change query on line 126 to:

PHP Code:

$posts $DB_site->query("
    SELECT post.*,post.username AS postusername,user.username,userfield.* 
    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(user.userid = userfield.userid)
    LEFT JOIN " 
TABLE_PREFIX "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
    WHERE post.threadid=
$threadid AND post.visible=1 AND deletionlog.primaryid IS NULL
    ORDER BY dateline 
$postorder
    LIMIT 
$startat$perpage
"
); 

Then add the fields as normal to the template.

vbmechanic 06-15-2004 03:32 PM

hey you beat me by a minute :D

Boofo 06-15-2004 03:46 PM

Sometimes that's all it takes. I guess great minds DO think alike, huh? LOL

Your line is different than mine here. Mine works, I tested it. Which one is correct?

PHP Code:

 LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid user.userid


vbmechanic 06-15-2004 03:52 PM

They are transposable, both are correct and usable ;)

Boofo 06-15-2004 04:01 PM

I thought so. Thanks for confirming it. I just copied that line from the post query in the showthread as it was. ;)

btappan 06-15-2004 04:47 PM

ahh, money talks! sounds like you would have taken for 5 bux! (damn!) Boofo- how do you want your$ and could you tell me how to make the printable version open in a new window?

Boofo 06-15-2004 05:03 PM

Quote:

Originally Posted by btappan
ahh, money talks! sounds like you would have taken for 5 bux! (damn!) Boofo- how do you want your$ and could you tell me how to make the printable version open in a new window?

Keep your money. I did it to prove to myself I could do it and to help you out at the same time. I code for fun and to learn. Money doesn't enter into it for me. ;)

As far as opening in a new window, just add:

target="_blank"

to the link. ;)

btappan 06-15-2004 05:50 PM

you guys are awsome :banana: I was losing hope....I'm slowly learning, my site is coming along and i'm getting better at modding templates, but not so much the php files yet, i always forget to llok at files outside of the CP. thanks alot!

SVTBlackLight01 08-21-2004 06:30 PM

Taking this a little further. How would you display attachments in the printable version?


All times are GMT. The time now is 04:46 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.01854 seconds
  • Memory Usage 1,762KB
  • 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_html_printable
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)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