2014-05-01, 08:44 PM
Pages: 1 2
2014-05-08, 06:28 PM
Hi really need this one anyone?
How to make this work?
How to make this work?
/ Add hooks here
$plugins->add_hook("showthread_end", "invalidthread");
// Plugin info
function invalidthread_info()
{
return array(
"name" => "invalidthread",
"description" => "invalidthread",
"website" => "invalidthread",
"author" => "invalidthread",
"authorsite" => "invalidthread",
"version" => "1.0",
"guid" => "",
"compatibility" => "16*"
);
}
function invalidthread() {
global $mybb, $thread, $lang;
if ($l['error_invalidthread']) {
error("working");
}
}
2014-05-10, 06:02 AM
This sounds handy. Wouldn't it better be done through .htaccess though?
2014-05-10, 01:00 PM
(2014-05-10, 06:02 AM)DrXotick Wrote: [ -> ]This sounds handy. Wouldn't it better be done through .htaccess though?
Hi thanks very much for your reply I though about it but don't know how to do it?
My SEO Plugin handles all errors except these I mean 404.....
How can I redirect invalid thread/forum using .htaccess?
2014-05-10, 01:20 PM
2014-05-11, 09:10 AM
Try this in your .htaccess. I would put it above any Google SEO code, but below rewrite engine on.
If that doesn't work out, or optionally... Make your custom 404.html as:
(obviously change example.com to your domain name.)
ErrorDocument 404 /index.php
If that doesn't work out, or optionally... Make your custom 404.html as:
<html>
<head>
<meta http-equiv="refresh" content="3; url=http://example.com/">
<title>Page doesn't exist. Redirecting you to homepage...</title>
</head>
<body>
Page doesn't exist. Redirecting you to homepage...
<br>
</body>
</html>
Content is the # of seconds before it will redirect. Set to 0 to make it immediate.(obviously change example.com to your domain name.)
2014-05-11, 11:49 AM
@DrXotick thanks very much man.
@Leefish great idea thanks a lot. I will replace all :
With:
Just nailed it thanks
P.S. Do you think I can create a plugin for this without modifying core files?
@Leefish great idea thanks a lot. I will replace all :
error($lang->error_invalidthread);
error($lang->error_invalidforum);
error($lang->error_invalidpost);
With:
if (in_array($mybb->user['usergroup'], array('3','4','6'))) {
error($lang->error_invalidthread);
}
else
{
redirect("index.php", some error goes here);
}
Just nailed it thanks
P.S. Do you think I can create a plugin for this without modifying core files?
2014-05-11, 04:23 PM
Just curious. Why would you create a plugin when you can put a single line in .htaccess
Ah. nevermind. I see you only want to target certain usergroups. Cheers.
Ah. nevermind. I see you only want to target certain usergroups. Cheers.
2014-05-12, 03:20 PM
(2014-05-11, 04:23 PM)DrXotick Wrote: [ -> ]Just curious. Why would you create a plugin when you can put a single line in .htaccess
Ah. nevermind. I see you only want to target certain usergroups. Cheers.
Hi I only want to redirect invalid forum, thread, post this is not 404!
2014-05-12, 05:18 PM
Didn't your mom ever teach you not to yell at strangers?
Pages: 1 2