Rusnak PHP Scripts Support Forums

Full Version: [MOD] - Custom Message for Deleted Forums
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
This mod will allow you to display a custom message for forums that have recently been deleted or pruned instead of the default "database error" message.

To install:

1. Open inc/db_mysql.php in Notepad or another text editor.
2. Find:

PHP Code:
/**
     * Output a database error.
     *
     * @param string The string to present as an error.
     */
    
function dberror($string="")
    {
        if(
$this->error_reporting)
        {
            echo 
"MySQL error: " $this->errno();
            echo 
"<br />" $this->error();
            echo 
"<br />Query: $string";
            exit;
        }
    } 

Replace With:

PHP Code:
/**
     * Output a database error.
     *
     * @param string The string to present as an error.
     */
    
function dberror($string="")
    {
        if(
$this->error_reporting)
        {
            echo 
"Your error message goes here";
            exit;
        }
    } 

Now your error message will be displayed when a forum admin tries to view a deleted forum.

BMR777
[Image: at.gif]
I think this would be nice for the AEF MOD also. Maybe I will look into this after I finish updating the script.
(not trying to copy from your PM)
kab012345 Wrote:
[Image: at.gif]
I think this would be nice for the AEF MOD also. Maybe I will look into this after I finish updating the script.
(not trying to copy from your PM)

Yeah, for this I just changed the default database error that MyBB outputs when something breaks and replace it with my own message. I'm sure the same can easily be done for AEF.

BMR777
how can i change the error i get whit the sub domain version ??

becouse i founded something nice that is working Smile

wp and mybb can both use the sub domain ( wp = http://www.sub.yourdomain.info/wp )

but the problem i got is that i want to change the sub domain error message (forum not found )

Greets From The Crasher
In the inc folder edit dbmysql.php. Find and edit:

PHP Code:
    if($this->error_number() && !$hide_errors)
        {
            echo 
"<center><br><br>The forum you are looking for cannot be found.  
It is possible that it was deleted, either due to a terms of service violation or due to inactivity.
<br><br><br><br><br><br><br></center>"
;
            exit;
        } 

If you're using MySQLi database then edit dbmysqli.php instead. Smile

BMR777
thank you , is it even posseble to put a iframe in it ?? so it kind redirect me to my homeforum ?? (showing my homepage )

becouse i dont know if space is allowed in that :S

Greets From The Crasher
I don't know about an iframe. There is a weird bug / glitch in that where anything you enter in once repeats twice. I don't know why though. You can put a link though. Smile

BMR777
i founded it Smile

try it out if you like it

http://Www.anysubdomain.powerchaos.info

this is the code if you are intrested Smile

search
PHP Code:
if($this->error_number() && !$hide_errors)
        {
            echo 
"<center><br><br>The forum you are looking for cannot be found.  
It is possible that it was deleted, either due to a terms of service violation or due to inactivity.
<br><br><br><br><br><br><br></center>"
;
            exit;
        } 
and replace it whit
PHP Code:
if($this->error_number() && !$hide_errors)
        {
            
header'Location: http://www.yoursite.com/new_page.html' ) ;
            exit;
        } 

Thank you and Greets From The Crasher
(08-11-2008 02:01 AM)powerchaos Wrote: [ -> ]i founded it Smile

try it out if you like it

http://Www.anysubdomain.powerchaos.info

this is the code if you are intrested Smile

search
PHP Code:
if($this->error_number() && !$hide_errors)
        {
            echo 
"<center><br><br>The forum you are looking for cannot be found.  
It is possible that it was deleted, either due to a terms of service violation or due to inactivity.
<br><br><br><br><br><br><br></center>"
;
            exit;
        } 
and replace it whit
PHP Code:
if($this->error_number() && !$hide_errors)
        {
            
header'Location: http://www.yoursite.com/new_page.html' ) ;
            exit;
        } 

Thank you and Greets From The Crasher
_______________________________________________________________

Well, I tried that Idea Crasher,... that came up with header errors:

Code:
Warning [2] Cannot modify header information - headers already sent by (output started at /home/account/public_html/forums/inc/db_mysqli.php:1) - Line: 309 - File: inc/db_mysqli.php PHP 5.2.9 (Linux)

So, I had to ditch that code for now.

However, your code did lead me echo line to be able to change the actual phrase, which I was happy to see that... However, I would have prefered to found a way to have the code either:

1) Go back automatically to the main site after so many seconds.
or
2) Have the code display a clickable link that users could click on
to go back to the main page.

I tried to implement the codes but it resulted into Fatal Errors.

For now, I just see the phrase duplicated. Which is fine by me,
but I would have liked to had found a way to make the page look pretty or give is some type of... skin?

UPDATE: Oh, crap, I can't edit the echo line at all.. If you try and edit the echo line, you will get header errors on every forum that you have... so, why are these updates being blocked???
sorry for bumping this old topic , but is it possible to explain how i can fix the double post ??

i tryed differend things , adding error codes to it ( if $stop=1 and stuff) to prevent double loading and it still shows me 2X the error message

its kinda irritating if you put a iframe it in to point to your main domain name

and that it shows 2X under each other :S

Thank you for your support
Greets From PowerChaos
Pages: 1 2
Reference URL's