The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How are array variables show to post?
Hi everyone,
My table, userid ------ threadid ---------- value 1----------------- 2 -------------- deger1 1----------------- 2 -------------- deger2 2----------------- 3 -------------- deger3 When I write “{vb:raw post.degerler}” at the postbit_legacy template, I want to see “deger1” and “deger2” (deger1 - deger2) the same time in the post, but I can see only “deger 2”. I’d ask you to help me about this situation. Thank you Best regards Sinan Coşkun |
#2
|
|||
|
|||
I thikn we need to see the code where you set $post['degerler'].
|
#3
|
||||
|
||||
I forgot, sorry
PHP Code:
|
#4
|
|||
|
|||
You need to do something like this:
Code:
$vericek= $db->query_read("SELECT value FROM ".TABLE_PREFIX."tablo WHERE threadid=2"); while ($veri=$db->fetch_array($vericek)){ $degerler[] = $veri['value']; } $post[degerler]= implode(' - ', $degerler); |
#5
|
||||
|
||||
Ok, but it was required separately as “deger1” and “deger2”, not “deger1-deger2”. Because i want to do hmm..
Examp: PHP Code:
|
#6
|
|||
|
|||
OK, you could do this:
PHP Code:
or if you want to keep your html separate from the code you could make a small template for the link and render it. There is a vb:each tag you can use in a template to loop through an array, but I don't know how you'd to the ' - ' between them. Edit:...unless there can only be one or two values? Then you could put them in separate values (like $post['degerler1'] and $post['degerler2']), then you could use a <vb:if... to check if the second one exists. |
Благодарность от: | ||
Sinan COSKUN |
#7
|
||||
|
||||
Yeees, that's thanks... very thanks
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|