vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Add prefix in code? (https://vborg.vbsupport.ru/showthread.php?t=209889)

MarkFoster 03-30-2009 05:26 PM

Add prefix in code?
 
1 Attachment(s)
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.

Lynne 03-30-2009 05:29 PM

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.

MarkFoster 03-30-2009 05:40 PM

Quote:

Originally Posted by Lynne (Post 1780516)
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.

Lynne 03-30-2009 05:52 PM

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.

MarkFoster 03-30-2009 05:57 PM

Quote:

Originally Posted by Lynne (Post 1780538)
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.

Lynne 03-30-2009 06:01 PM

But your code in post one is wrong. It's not going to show a thing.

MarkFoster 03-30-2009 06:03 PM

Quote:

Originally Posted by Lynne (Post 1780549)
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?

Lynne 03-30-2009 06:17 PM

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.

MarkFoster 03-30-2009 06:43 PM

Quote:

Originally Posted by Lynne (Post 1780562)
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?

Lynne 03-30-2009 06:48 PM

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.


All times are GMT. The time now is 11:09 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.06393 seconds
  • Memory Usage 1,757KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_html_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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