Quote:
Originally Posted by kh99
OK, sorry, if I had read your first post carefully I would have seen that. Anyway, I created a plugin using hook parse_templates and this code:
PHP Code:
$templater = vB_Template::create('vbcms_twitter');
$templater->register('cistwitter', $cistwitter);
$templatevalues['cistwitterarray'] = $templater->render();
vB_Template::preRegister('vbcms_content_article_page', $templatevalues);
Then I created a template named vbcms_twitter that had only the word 'test' in it. Then I edited the vbcms_content_article_page template and just under the css line at the top I added {vb:raw cistwitterarray}. Now when I view an article I get "test" at the top, so that seems to work.
When you want to use the user's actual twitter profile field, the $userinfo won't work. You could use $vbulletin->userinfo, but that would show each user their own profile field, and I have a feeling that's not what you want. If you want the article author's twitter field, I'm not sure how to do that offhand.
|
That does work. It looks like my issue is $userinfo is not available on the CMS, so..
PHP Code:
$cistwitter = $userinfo["field{$vbulletin->options['cistwitterprofilefield']}"];
does not work because of userinfo. How can I make this available?
--------------- Added [DATE]1417847973[/DATE] at [TIME]1417847973[/TIME] ---------------
when I try the below I get my profile field6 instead of the person who posted the article
PHP Code:
$cistwitter = $vbulletin->userinfo['field6'];