The Arcive of vBulletin Modifications Site. |
|
#1
|
|||
|
|||
![]()
Hi all
I used this nice plugin to show author avatar in the articles. http://www.vbulletin.com/forum/forum...o-cms-articles The problem is, I don't want to show avatars in all articles, but only on opinion articles and reviews, but for news articles no avatars at all. I thought in this problem, and then added a custom field to the articles to show or not show user avatars, I followed this nice article (guide) https://vborg.vbsupport.ru/showthread.php?t=257589 Actually I did the first 4 points, and it seems work great (changing and saving every time), but I don't complete the steps. What I want know, is how I can use my new field to control the plugin that shows avatars? let we say the new field named showavatar. Sorry but I'm very new in coding vb4 and vbcms Thanks in advance |
#2
|
||||
|
||||
![]()
If the new field is called showavatar, then grab the variable at the beting of your show author avatar plugin and then use it in a condition:
PHP Code:
|
#3
|
|||
|
|||
![]()
Thank you for your appreciate help.
How I can grab the variable Lynne? |
#4
|
||||
|
||||
![]()
You didn't really say where you added it, so I don't really know. You probably have to do a query unless the variable is already there. I really can't tell since you have posted no code or anything.
|
#5
|
|||
|
|||
![]()
Thank you Lynne for your reply.
I want to display the avatars in both article page and section page (article preview). By technical words I want to display avatar in "vbcms_content_article_page" and "vbcms_content_article_preview" templates, and now without the condition the avatars shows very well, but as I said before I don't want to show avatars for all articles. Here is the code that reefland added in vb.com PHP Code:
PHP Code:
BTW, regarding to this article, https://vborg.vbsupport.ru/showthread.php?t=257589 I try to complete the steps to show another field in articles, but I get error 500 when adding the plugin in step 9 !! Waiting for your help Lynne ![]() |
#6
|
||||
|
||||
![]()
And what hook location did you use for the $avatarurl code? Perhaps that hook isn't used on the section page. Also, you can't just preregister the variable, you also need to actually add that variable to the template you preregistered it for use in.
|
#7
|
|||
|
|||
![]()
I put the code in the hook as this thread says
http://www.vbulletin.com/forum/forum...o-cms-articles "vbcms_article_populate_end". As I told you, now without conditions the avatars appears in both pages (article page and section page). --------------- Added [DATE]1365811144[/DATE] at [TIME]1365811144[/TIME] --------------- Is there any suggestion? ![]() |
#8
|
||||
|
||||
![]()
You said:
Quote:
|
#9
|
|||
|
|||
![]()
The new field as I told you in the previous post named "showavatar", and it added to cms_node table.
I did every thing in this plugin http://www.vbulletin.com/forum/forum...o-cms-articles and it is work as charm, but I want now to use my showavatar field to show/hide avatars. --------------- Added [DATE]1365815805[/DATE] at [TIME]1365815805[/TIME] --------------- As I told you, I'm new with vb4 and vbcms, I'm just coming from days of vb3, so every thing is new for me and I'm confused a little bit, I want to use my field value (1 or 0) to control the whole process, but I want to declare the showavatar in the plugin before I can use it in the condition, but I don't know how I can do this ![]() --------------- Added [DATE]1365815898[/DATE] at [TIME]1365815898[/TIME] --------------- The plugin now without the condition works great, just to clear the picture ![]() |
#10
|
||||
|
||||
![]()
If you added it to that table, did you also modify the query that grabs fields from that table to make sure to grab that field?
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|