The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Is there a way to set the order in a setting for info added to an option like the following?
PHP Code:
Now, if I want to change the order that those things get added to the option, is there a way to do that in PHP? I know switch will allow me to choose one of them but I want to be able to set the order somehow. |
#2
|
||||
|
||||
![]()
Which order? You're concatenating strings... if you want to change the order, well, change the order of the lines.
|
#3
|
||||
|
||||
![]()
I understand that. I was just wanting to know i it was possible to do it automatically with setting.
|
#4
|
||||
|
||||
![]()
Can you elaborate a bit more detailed? I'm not quite sure I get what you want to accomplish.
Maybe use arrays instead of appends? PHP Code:
PHP Code:
PHP Code:
|
#5
|
||||
|
||||
![]()
Thank you for responding to this.
![]() What I want to be able to do is set it so that they can be listed/added in any order the user wants. Like 1,2,3,4,5, or 4,1,3,2,5 and so on. This is going in the footer and there are only 2 hooks there that are of no use for something like this, so this is the way I have to do it for now. Since the copyright text is anchored right below the "time is now", that is a good area to be able to add things to. Does that make any sense? I'm not very good at explaining things at times. |
#6
|
||||
|
||||
![]()
ok now I get it.
Sadly, no there is absolutely no way to accomplish this. It's not the best method to start with, but the vb template system has always been a bit clunky imho. If you want to make sure a certain text appears at a certain position, use extra templatehooks or guide the user how he/she can change the order by themselves. The only thing you can force is the to be inserted text appear at the beginning or the end. PHP Code:
//e: Another method would be, if you know there is already text in the template var inserted and you want to put your text at a certain position, you can split the string, place yours and convert it to a string again: PHP Code:
|
#7
|
||||
|
||||
![]()
Yes, I agree. There isn't much you can do with it the way it is. I don't like doing it this way but there really is no other choice if I want to make it as automatic as possible. They will just have to live with the order I put them in unless they want to edit the plugin, I guess. Since this was mainly for my own site, I set it up to how I use it.
Thanks for verifying what I suspected, though. ![]() --------------- Added [DATE]1326297407[/DATE] at [TIME]1326297407[/TIME] --------------- Quote:
|
#8
|
|||
|
|||
![]()
Assuming you have each item stored in a table, why not add an 'order_by' column to the table and give the user the option to number them in the order they want?
Then query the table with order by order_by and display. |
#9
|
||||
|
||||
![]()
After all it's better to let the user modify the template on their own, not with template hooks but with html, just as they want it to look like.
|
#10
|
||||
|
||||
![]() Quote:
Quote:
![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|