The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
vbulletin 3.8 array parse problem.
my array
PHP Code:
my template PHP Code:
not printing please help me.. |
#2
|
|||
|
|||
You would need something like:
Code:
$users[1][username] $users[2][username] etc Or you could use a for loop in a plug to format your names into a string, then include the string. |
Благодарность от: | ||
ayazoglu |
#3
|
|||
|
|||
Quote:
PHP Code:
|
#4
|
|||
|
|||
There's no way to do that in a vbulletin template (in vb3). You can use a plugin to create a string (I meant plugin above, not 'plug') then put the string in a template.
|
#5
|
|||
|
|||
my sql table
tablename -> programs - id - url - sahip this table while print for vbulletin How do I make a plug-in to do this Loop through the screen to write the data into the database |
#6
|
|||
|
|||
Sorry, I don't quite undertsand all that. But I'm talking about something like this:
Code:
$users = array( 1 => array('username' => 'Adam', 'email' => 'adam@adam.com'), 2 => array('username' => 'Ben', 'email' => 'ben@ben.com'), 3 => array('username' => 'Chris', 'email' => 'chris@chris.com') ); foreach ($users as $user) { $userbits .= '<TR><TD>' . $user[username] . '</TD><TD>' . $user[email] . '</TD></TR>'; } Then in the template: Code:
<TABLE> $userbits </TABLE> You could also use a template for each user instead of coding in the html, like: Code:
foreach ($users as $user) { eval('$userbits .= "' . fetch_template('my_userbit') . '";'); } Then you'd need a new my_userbit template something like: Code:
<TR><TD>$user[username]</TD><TD>$user[email]</TD> It's exactly the same except that the html is in a template. |
#7
|
|||
|
|||
very good
thanx kh99 |
#8
|
|||
|
|||
Quote:
BTW, I just realized that the reason you saw "ARRAY" when you tried to follow my suggestion is because it needed curly braces around them, like: Code:
{$users[1][username]} {$users[2][username]} Sorry about that. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|