![]() |
|
Thread Tools |
#1
|
||||||||
|
||||||||
str replace into forumhome_forumbit_level2_post
I have read the other threads about this but none had helped me.
I have added an option in the editing/creating a forum page. My option variable is $forum[var]. When I place the variable {vb:raw forum.newoption} directly into forumhome_forumbit_level2_post it works, it displays the data. So I'm trying to do this via plugin with the following code:
The plugin works, but I get the variable outputted, not the data that is storing. After this, I did try using a template, with the variable in it. Then I registered and rendered the template y used that to str replace.
This works, but outputs the same data for each forum, even if I just inserted some values in my option in only one forum. I must say that I'm new creating plugins, maybe I'm missing something. No members have liked this post.
|
#2
|
||||||||
|
||||||||
is for templates not plugins. It would be more like the following:
No members have liked this post.
|
#3
|
||||
|
||||
That works as my template approach.
The variable ouput get repeated into the next forum, even is the next has its own value. The second forum shows its value, but the value from the previous forum. I'm looking into the vBulletin files to see how they do that, I'm not good at this but i'm learning ![]() No members have liked this post.
|
#4
|
||||
|
||||
can you paste more of your code
Did you set your own variable for $forum or $forum[newoption] I am not totally understanding what it is you want to do. I think you want to grab the postid for each post. add this in your code towards the bottom:
Tell me the output that shows above the header. No members have liked this post.
|
#5
|
||||
|
||||
You probably need to zero it out prior to setting it. That way, if you don't set it for that particular forum, it won't show the previous setting.
__________________
Former vBulletin.org Staff Member
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before. W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
#6
|
||||||||||||||||
|
||||||||||||||||
$forum[newoption] is from the options when editing a forum. I've added a new option there:
hook: forumadmin_edit_form
I then validated the data: hook: forumdata_start
I also added a iconlocation field to the forum table in my database. That part works as spected. It saves the data. Now using the variable directly into my template it works as spected too: $forum[iconlocation] as {vb:raw forum.iconlocation} The problem is trying to insert that variable using a plugin:
I've attaced a screenshot so you can see what i'm talking about. Also the output for var_dump($forum[iconlocation]); is
No members have liked this post.
|
#7
|
||||||||
|
||||||||
try this:
you can remove this:
No members have liked this post.
|
#8
|
||||
|
||||
No, that isn't the problem. If I use that I get printed the variable names, not the data.
Thank you for your help, I'm going to release the plugin as it is, and ask the user to make a template edit to insert the html code. I can't make it work. No members have liked this post.
|
#9
|
||||
|
||||
When you release it I will take a look and see if I cant make it work the way you want.
No members have liked this post.
|
#10
|
||||
|
||||
It's been released. Actually without automatic template edit the product is useless since the same icon can be added into the forum description without having to modify templates
![]() http://www.vbulletin.org/forum/showthread.php?p=1925448 No members have liked this post.
|
#11
|
||||
|
||||
Well after looking whats wrong with a template?
Just do a auto template with in the xml file. No members have liked this post.
|
#12
|
||||
|
||||
Here's an example of how I do it. Not sure what issues your code is having.
Essentially, call your template using vB_Template::fetch_template_raw('templatename') - that way it pulls the raw code needed to be eval'd at the end. If you do it that way, it shouldn't fail. Good luck.
__________________
Along with Zachery, I make releases as GeekyDesigns. Please do not PM or IM me for support. No members have liked this post.
Last edited by Link14716; 05 Dec 2009 at 11:51. |
#13
|
||||
|
||||
Hey Elmer sorry it took so long been busy.
Here is what you are looking for:
Make a plugin with the hook location process_templates_complete I named mine "Forum Icon Template Replacement" Put the code from above in there. Be advised there is no if statement so it shows for every forum even if there is no icon in place I left that for you to do. No members have liked this post.
|
#14
|
||||
|
||||
Thaks BBR, I will try again, I'll let you know if it works.
No members have liked this post.
|
![]() |
«
Previous Thread
|
Next Thread
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 19:55.