![]() |
So do I need to create a separate layout for these pages to basically have a static page widget in there?
|
Back from the dead, I found this code in an old post on vb.com, but it doesn't seem to work. It should add the author's avatar to the templater and allow me to use it on the article and preview templates, however it is only showing my avatar, not the avatar of the article author. Note: this is only on previews. When I view an article itself, the correct avatar shows.
(Figured I'd use this thread since it is still relevant). PHP Code:
And another question, I see that I can choose sections to display on a page, but there isn't an option to only show articles from a certain category within that section. Is this intended or am I using the wrong widget in the layout? And one last question, the CMS preview tries to pull an image for the "preview" of the article, and then disables any images in the post from showing in it. Can I turn this off and allow the previews to show the images? |
Friendly bump. The most pertinent question is the code I provided for the avatar. ^^ Everything else can be worked around I suppose. ^^
|
What hook are you using?
|
vbcms_article_populate_end
I read somewhere this was the appropriate hook. |
It seems to work correctly on my test install. Maybe another plugin is interfering?
|
On the previews it shows other people's avatars? It works for me, however only my avatar appears, even if I am not the author of the article.
|
Two authors:
string 'image.php?u=2&dateline=1420404720&type=th umb' (length=52) string 'image.php?u=1&dateline=1420403212&type=th umb' (length=52) string 'image.php?u=1&dateline=1420403212&type=th umb' (length=52) string 'image.php?u=1&dateline=1420403212&type=th umb' (length=52) string 'image.php?u=1&dateline=1420403212&type=th umb' (length=52) string 'image.php?u=1&dateline=1420403212&type=th umb' (length=52) string 'image.php?u=1&dateline=1420403212&type=th umb' (length=52) --------------- Added [DATE]1420421196[/DATE] at [TIME]1420421196[/TIME] --------------- I lied. Somehow it got changed going into the template. --------------- Added [DATE]1420421442[/DATE] at [TIME]1420421442[/TIME] --------------- This worked for me: PHP Code:
|
Will try.
Edit: it works, thanks. Could you explain why your change worked so I can know for future reference? My guess is that pre-registering only did the value of one thing and once that value was registered any change afterward will affect the variable? Any help on the additional questions would be appreciated (from anyone). Thanks for the help! |
Quote:
I didn't track your code back to see why the values were being changed, so I don't know why it wasn't working correctly. |
Okay, I've figured out most of this, but I have a question: I created sub-sections and allow them for sub-nav, but there aren't any sub-menus (like you can create in the normal namv manager). Am I missing something when it comes to these?
I'm also still looking for a way to display images in a preview normally. |
So, after updating to the latest patch, the plugin is no longer passing the avatar to the template. :/
|
That's odd.
I'll take a look at it. |
Thanks Eddie.
Also, thanks to HM666 who helped me finally get the CMS menu to play nice. It's finally behaving (almost) like I want it to. I'm still searching for ways to disable the CMS's suppression of in-article images on the previews if anyone can help. |
Thanks to Dead Eddie for helping me out with the avatar issue. Now all I need is to disable the CMS from automatically removing images from previews. Any help would be appreciated.
|
Looks like it's in vB_BbCodeParser::getPreview()
PHP Code:
|
I found the code and commented it out, and now it shows the code, but isn't parsing anything...
|
Up a few lines in the same method...
PHP Code:
|
Saw that and tried as well with no luck. ^^ Also cleared my cache as well and no change.
|
Sorry, yeah. You need to load the Image BBCode parser into the method. You can look at the way it's done in the parse method as an example.
|
Alright. I'll try to find where to do that. Thanks for the help.
|
Hey guys, I'm still having no luck figuring out where to add/remove code to parse the BBCode in article previews. ANy help would be great!
|
Still working on the above issue, but I have another concern.
I have some PHP I'd like to put in a CMS direct evaluation. I followed the rules, doing anything but then setting the $output variable, but all I get is a white page. I have tested this code via a plugin we have to create pages via the forum and it works as intended. Are there functions that are disallowed in the CMS? |
Hey guys. So the BBCode issue is still one I need help solving. I have it displaying but not being executed. Second, the PHP I am attempting to put in a direct evaluation page through CMS is below, except I have changed everything from "echo" to $var = or$var.=, then set $output = $var; at the end. This code IS working on the site on a non-VMS page.
PHP Code:
|
Summary: DIV is supposed to include PHP output, instead div is there but contains nothing (even though the php code is in the div) and preview output is below it.
EDIT: Contained everything in a div with max height 100% and that seemed to fix it. Now, about that BBCode in article previews.... |
All times are GMT. The time now is 01:00 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|