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

Reply
 
Thread Tools Display Modes
  #1  
Old 03-30-2009, 06:26 PM
MarkFoster MarkFoster is offline
 
Join Date: Jun 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Add prefix in code?

I have a code that grabs information from threads for a box on my portal, but it Can't grab prefixes which would be pretty important.

Could sombdy edit this code for me so it will include thread prefixes:
Code:
<a href="$vboptions[bburl]/news.php?id=$thread[threadid]" $thread[prefix_plain_html] title="$thread[title]"><strong>$thread[title]</strong></a><br />
$dateposted<br />
Posted by <strong><a href="$vboptions[bburl]/member.php?u=$thread[postuserid]">$thread[postusername]</a></strong><br />
<font size="2" face="Times" color="#383838">
	$message
</font>
<br /><br />
Look in attachments what it's for.
Attached Images
File Type: png rwcnews.png (40.0 KB, 0 views)
Reply With Quote
  #2  
Old 03-30-2009, 06:29 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to have grabbed the prefixid in your query for the threads. Then in the php (your plugin or page code):
PHP Code:
if ($latestthread['prefixid']) 

$latestthread['prefix_plain_html'] = htmlspecialchars_uni($vbphrase["prefix_$latestthread[prefixid]_title_plain"]); 
$latestthread['prefix_rich'] = $vbphrase["prefix_$latestthread[prefixid]_title_rich"]; 

else 

$latestthread['prefix_plain_html'] = ''
$latestthread['prefix_rich'] = ''

And you can use one of those in your template.
Reply With Quote
  #3  
Old 03-30-2009, 06:40 PM
MarkFoster MarkFoster is offline
 
Join Date: Jun 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
You need to have grabbed the prefixid in your query for the threads. Then in the php (your plugin or page code):
PHP Code:
if ($latestthread['prefixid']) 

$latestthread['prefix_plain_html'] = htmlspecialchars_uni($vbphrase["prefix_$latestthread[prefixid]_title_plain"]); 
$latestthread['prefix_rich'] = $vbphrase["prefix_$latestthread[prefixid]_title_rich"]; 

else 

$latestthread['prefix_plain_html'] = ''
$latestthread['prefix_rich'] = ''

And you can use one of those in your template.
Thanks for helping out but I don't know what I should do with the code :/
I don't know how to do a query and it's actually a template.
Reply With Quote
  #4  
Old 03-30-2009, 06:52 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It could already be available for use - I don't know. You have this in the middle of your template that you posted above:
HTML Code:
$thread[prefix_plain_html]
It's just sitting in the <a> tag which is weird and won't have it show in front of the thread title. If you want it to show, you need to have it outside of the middle of the <a> tag.
Reply With Quote
  #5  
Old 03-30-2009, 06:57 PM
MarkFoster MarkFoster is offline
 
Join Date: Jun 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
It could already be available for use - I don't know. You have this in the middle of your template that you posted above:
HTML Code:
$thread[prefix_plain_html]
It's just sitting in the <a> tag which is weird and won't have it show in front of the thread title. If you want it to show, you need to have it outside of the middle of the <a> tag.
No it didn't work, I added that part to the code before I posted this, apprently nothing works so I need some code for it.
Reply With Quote
  #6  
Old 03-30-2009, 07:01 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But your code in post one is wrong. It's not going to show a thing.
Reply With Quote
  #7  
Old 03-30-2009, 07:03 PM
MarkFoster MarkFoster is offline
 
Join Date: Jun 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
But your code in post one is wrong. It's not going to show a thing.
This is the original code:
Code:
<a href="$vboptions[bburl]/news.php?id=$thread[threadid]" title="$thread[title]"><strong>$thread[title]</strong></a><br />
$dateposted<br />
Posted by <strong><a href="$vboptions[bburl]/member.php?u=$thread[postuserid]">$thread[postusername]</a></strong><br />
<font size="2" face="Times" color="#383838">
	$message
</font>
<br /><br />
Coudl you edit it for me to get it working with prefixes?
Reply With Quote
  #8  
Old 03-30-2009, 07:17 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If it's available for use, it should show up with this code:
Code:
$thread[prefix_plain_html] <a href="$vboptions[bburl]/news.php?id=$thread[threadid]" title="$thread[title]"><strong>$thread[title]</strong></a><br />
$dateposted<br />
Posted by <strong><a href="$vboptions[bburl]/member.php?u=$thread[postuserid]">$thread[postusername]</a></strong><br />
<font size="2" face="Times" color="#383838">
    $message
</font>
<br /><br />
If that doesn't work, then you will have to ask for help in the modification thread for help modifying the query for the threads.
Reply With Quote
  #9  
Old 03-30-2009, 07:43 PM
MarkFoster MarkFoster is offline
 
Join Date: Jun 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
If it's available for use, it should show up with this code:
Code:
$thread[prefix_plain_html] <a href="$vboptions[bburl]/news.php?id=$thread[threadid]" title="$thread[title]"><strong>$thread[title]</strong></a><br />
$dateposted<br />
Posted by <strong><a href="$vboptions[bburl]/member.php?u=$thread[postuserid]">$thread[postusername]</a></strong><br />
<font size="2" face="Times" color="#383838">
    $message
</font>
<br /><br />
If that doesn't work, then you will have to ask for help in the modification thread for help modifying the query for the threads.
Didn't work :/
What about the first code you posted, can I use that for anything?

There really isn't a modification released for it because I payed fore it and the creator isn't around anymore.
Any way a XML could be edited for this?
Reply With Quote
  #10  
Old 03-30-2009, 07:48 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The code I posted is what I use in a modification I have for my site. I had to modify the query that grabs the threads and add the prefixid to the field list and then use that code to 'create' the prefix to be used in the template. You can probably edit your modification to do all this. Play with it on your test site - that's the best thing to do when you need to figure things out.
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 06:56 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.05469 seconds
  • Memory Usage 2,293KB
  • Queries Executed 12 (?)
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
  • (4)bbcode_code
  • (2)bbcode_html
  • (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
  • (2)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
  • (1)postbit_attachment
  • (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_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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete