View Full Version : Plugin causing issues with php 7.1
katie hunter
08-27-2018, 01:14 AM
Hi,
I've installed a new vb but i used php 7.1 however i am reciving errors from the plugin. I don't want to downgrade my php really to 5.6.
Php 7.1 runs faster than 5.6, correct ? What do i do to get my plugins to work ? this is the first plugin i tried to test and it is an important one.
MarkFL
08-27-2018, 02:09 AM
What is the plugin code?
katie hunter
08-27-2018, 02:15 AM
Hi Mark - there are several plugins.
The first one is recapcha new (i get a white page in registration page if i ever use it) Edit: The fix is on the last page of the plugin, this one is fixed.
https://vborg.vbsupport.ru/showthread.php?t=315960
The next one is sphynix search
https://marketplace.digitalpoint.com/sphinx-search-for-vbulletin-4.870/item
The third one is a custom made for my header , that is the one i first tried and give me the error i mentioned above:
MarkFL
08-27-2018, 02:41 AM
Try this code in your custom plugin:
if ($vbulletin->userinfo['userid'])
{
require_once('./includes/functions_user.php');
$ava_url = fetch_avatar_url($vbulletin->userinfo['userid']);
$avatar = $ava_url[0];
if (!avatar)
{
$ava_url[0] = "images/misc/unknown.gif";
}
$ava_urlX = $ava_url[0];
$nhn_avatar = "<a href=\"profile.php?do=editavatar\"><img src=\"$ava_urlX\" width=\"50\" height=\"50\" border=\"0\" alt=\"Your Avatar\" style=\"vertical-align: middle; margin-right: 5px; margin-top: -4px; border-radius: 5px;-moz-border-radius: 5px;-ms-border-radius: 5px;-o-border-radius: 5px;-webkit-border-radius: 5px;\" /></a>";
$templater = vB_Template::create('header');
$templater->register('nh_avatar', $nhn_avatar);
vB_Template::preRegister('header',array('nhn_avata r' => $nhn_avatar));
$templater->render();
}
katie hunter
08-27-2018, 03:09 AM
Hi Mark - add this code where ? replace the entire file with your code ?
Edit: i applied your changes but still same issue:
MarkFL
08-27-2018, 11:53 AM
Replace the actual plugin code. No need to edit the .XML file.
katie hunter
08-27-2018, 02:29 PM
Hi Mark, i tried it but it gave me an error when i tried to import the xml file after i updated
XML Error: Not well-formed (invalid token) at Line 3
Edit: now it works !! <3 i went to edit in Installed Products and replaced your code in the install new code and saved. But trying to edit the xml file and upload it didn't work, it gave me that error above.
What did you do to fix it ? so i can apply it to other plugins that has similar issues like the sphynix right now has that same issue:
MarkFL
08-27-2018, 04:19 PM
I'm surprised that was part of the installation code...it should have simply been in a plugin. As far as Sphinx, I would speak to its developers.
katie hunter
08-27-2018, 11:08 PM
I'm surprised that was part of the installation code...it should have simply been in a plugin. As far as Sphinx, I would speak to its developers.
They ceased updating it, but i have many the same issues with the xml files, what do i need to replace to be compliant with php 7.x ?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.