2010-09-17, 09:26 PM
Hello all,
http://mods.mybb.com/view/view-single-post
Was one of the first plugins installed 2 years ago in my board. Worked good until it was deactivated for upgrading reasons. I have been trying to contact the author arash_j13 with no luck so far. So that´s why I´m starting this thread.
The thing is...when I click Activate, a blank page shows up with a message that I was used to see in Wordpress, being the first time that I see it on MyBB. So I got surprised.
The message:
Here is the viewpost.php file plugin:
The plugin is obviously deactivated but I would like to know if it´s something wrong with it now that I´m running the latest MyBB version or, if it´s not a plugin problem then...is it that my memory size is not enough?....how to increase it?
Thanks.
PD: Apologies if this is in the wrong forum section.
http://mods.mybb.com/view/view-single-post
Was one of the first plugins installed 2 years ago in my board. Worked good until it was deactivated for upgrading reasons. I have been trying to contact the author arash_j13 with no luck so far. So that´s why I´m starting this thread.
The thing is...when I click Activate, a blank page shows up with a message that I was used to see in Wordpress, being the first time that I see it on MyBB. So I got surprised.
The message:
Quote:Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 95789537 bytes) in /home1/XXXXXXX/public_html/bb/inc/adminfunctions_templates.php on line 56
Here is the viewpost.php file plugin:
<?php
/*
view post 0.8.0
by arash_j13
E-mail : [email protected]
*/
$plugins->add_hook("postbit","viewpost_insert_url");
$plugins->add_hook("showthread_start","viewpost");
function viewpost_info()
{
return array(
'name' => 'viewe post',
'description' => 'display post',
'website' => 'mailto:[email protected]',
'author' => 'Arash_j13',
'authorsite' => 'mailto:[email protected]',
'version' => '0.8.0',
);
}
function viewpost_activate()
{
require '../inc/adminfunctions_templates.php';
find_replace_templatesets("postbit",'#'.preg_quote('{$post[\'posturl\']}').'#',
'{$post[\'viewpost\']}{$post[\'posturl\']}');
find_replace_templatesets("viewpost",'##','<html>
<head>
<title>{$title}</title>
{$headerinclude}
<script type="text/javascript">
var quickdelete_confirm = "{$lang->quickdelete_confirm}";
</script>
<script type="text/javascript" src="jscripts/thread.js?ver=120"></script>
</head>
<body>
{$header}
<table border="0" cellspacing="{\$theme[\'borderwidth\']}" cellpadding="{\$theme[\'tablespace\']}" class="tborder" style="clear: both;">
<tr>
<td class="tcat" width="15%"><span class="smalltext"><strong>{\$lang->author}</strong></span></td>
<td class="tcat" width="85%"><span class="smalltext"><strong>{\$lang->message}</strong></span></td>
</tr>
{\$viewpost}
</table>
<br />
{\$footer}
{\$viewpost_copy}
</body>
</html>',1);
}
function viewpost_deactivate()
{
global $db;
require '../inc/adminfunctions_templates.php';
find_replace_templatesets("postbit",'#'.preg_quote('{$post[\'viewpost\']}').'#','',0);
$db->delete_query(TABLE_PREFIX."templates","title='viewpost'");
}
function viewpost_insert_url($post)
{
global $postcounter,$tid;
$url="./showthread.php?action=viewpost&tid=$tid&pid={$post['pid']}";
$post['viewpost']="<a href=\"$url\">#{$postcounter}</a>" ;
}
function viewpost()
{
global $mybb,$db,$lang,$templates;
if (isset($mybb->input['action']) && $mybb->input['action']=='viewpost')
{
$lang->load('viewpost');
$pids="p.pid={$mybb->input['pid']}";
$query = $db->query("
SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
LEFT JOIN ".TABLE_PREFIX."users eu ON (eu.uid=p.edituid)
WHERE $pids
LIMIT 0,1
");
if($post = $db->fetch_array($query))
{
$viewpost=build_postbit($post);
}
else
error($lang->invalidpost);
$title=$lang->vp_viewpost." : ".$post['subject'];
$viewpost_copy='<div class="smalltext" align="center">
View post Copyright © <a href="mailto:arash_j13$yahoo.com"><strong>Arash_j13</strong></a></div>';
global $headerinclude,$header,$footer;
eval("\$view_post = \"".$templates->get("viewpost")."\";");
output_page($view_post);
}
}
?>
The plugin is obviously deactivated but I would like to know if it´s something wrong with it now that I´m running the latest MyBB version or, if it´s not a plugin problem then...is it that my memory size is not enough?....how to increase it?
Thanks.
PD: Apologies if this is in the wrong forum section.