1. Additional details in Error Page

Additional details in Error Page

  |   30
Additional details in Error Page

Well, this tutorial is here because we have our good friends in V.I.P. section asking how to make the error page to be more interesting and look good with something else other than regular error messages, so that's why we have this tutorial...

Thank you to "ivanov16" to bring up this topic to ask for hack, he had mentioned how to get the error page to look like this site url and Gozan to support the topic...so here we are...

First of all I have been thinking a lot of possibilities to get the hack for it and which file to modify to get anything we want to add or remove....Guess what? I have been thinking too much! Because the manner of fact is it's very simple and no DLE script and core files and modules need to be modified...the answer is "Modify the info.tpl" theme file! oh yea..that's simple...

Basically the info.tpl is the file that handle and display all error messages in DLE (mostly 404 and 301) and the file use only couple tags based on the tutorial by spamhater here about info.tpl, but we want more than that right?, simply add more then? add what?....whatever you want! that's right! whatever you want, you can add it here in this file, I was thinking about 3News module would be perfect module for this tutorial...

So simply open {THEME}info.tpl and add the code at the end if the info.tpl file like this
[not-aviable=userinfo|pm|main|showfull]
<div style="clear:both"></div>
<ul style="margin:0; padding:0; display:block;">
<li style="width:33%; display:inline; float:left; padding:0; margin:0">
<h3>Latest News</h3>
<ul class="newslist">{last_news}</ul>
</li>
<li style="width:33%; display:inline; float:left; padding:0; margin:0">
<h3>Top News</h3>
<ul class="newslist">{top_news}</ul>
</li>
<li style="width:33%; display:inline; float:left; padding:0; margin:0">
<h3>Recommend News</h3>
<ul class="newslist">{rand_news}</ul>
</li>
</ul>
<div style="clear:both"></div>
[/not-aviable]

In this example I use {last_news}, {top_news} and {rand_news} display with the error page, if you have not installed 3News module, please download and install it and use like example above, the style or customize can be different depends on your theme and design, you and add something else or remove and modify anyway you want, it's your choice...

in the code above you also see tag [ not-aviable ], this because I want to remove the 3News from specific page, for example "main", you should always remove this from main page because you don't need it in main page and question is what kind of error messages will display in main page? oh yes, there are some like login error, incorrect password etc..those error will withdraw in main page, so I would strongly recommend to remove the additional info from main page by specify in not-aviable tag. The other page I would recommend is userinfo, in most website allow pending articles for approval, those articles will be listed under user profile, but if there is no article pending for that user then DLE will show info page like "no article pending for approval" or "article box empty" etc. this will draw info.tpl by default, so I would recommend to remove the 3News from userinfo but you can leave it if you want. PM usually you can leave this on not a big deal but normally it will draw when you have error in sending message or message sent, so you don't really need it that's why I added it in the list...to remove them simply use the tag [ not-aviable ] like in the example, you can remove from other pages as well, for more details about the tag and options for not-aviable, please visit this topic Basic Main tag and page displays look at under section "aviable" because it uses the same options.

The best part is, you can add anything you want in this file like banner, ads, google search box or whatever you want here...so feel free to suite up yourself...

To see the example above in action, please see it here: http://themes.dlestarter.com/documents/ (Please change theme to "GStarter")
The code for info.tpl file to display the result can be found here: http://themes.dlestarter.com/templates/GStarter/info.tpl

That's all folks, simple ah? oh yea....and works with all 8.x and 9.x of DLE...

Enjoy...
Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.

Details

+10

Comments 30

spamhater
spamhater
DLE TEAM
Commented By spamhater on December 21, 2011 (9:35 pm)
holy holy...no one ever thought about that...hahaha...that's simple...!
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
romeoluv56
Commented By romeoluv56 on December 22, 2011 (5:30 am)
great share thanks buddy, you can add showfull in not available tag so when guest viewing full story it wont show over there...

Thanks
KingOfDCP
KingOfDCP
Members
Commented By KingOfDCP on December 22, 2011 (10:12 am)
I installed 3news module and can use it on main.tpl but I can't use it on info.tpl. They just show variable name {top_news} only. How can I fix that?
N/A 9Forum topics : 3Forum replies : 18Forum likes : 0

Download latest mac games and applications at http://i-fresh.net
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on December 22, 2011 (11:52 pm)
romeoluv56,
yes you can do that, simply add
[not-aviable=userinfo|pm|main|showfull]

There is no download in this tutorial, so anyone can add and remove anything...

Thanks for advice...

KingOfDCP,
umh, that's strange..it should work fine, however, I will take a look at that...which version of your DLE you are using?
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
Gozan
Gozan
V.I.P.
Commented By Gozan on December 23, 2011 (2:59 pm)
hi guys poka

i`m not using 3news module ^^, what should i do? feel



http://freevipcare.com/uploads/1324652810_err404.png
33 132Forum topics : 20Forum replies : 88Forum likes : 7
ivanov16
ivanov16
V.I.P.
Commented By ivanov16 on December 23, 2011 (4:45 pm)
perfect, thank sawanbanna :D
N/A 60Forum topics : 27Forum replies : 106Forum likes : 1
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on December 23, 2011 (6:42 pm)
Quote: Gozan
i`m not using 3news module ^^, what should i do?

You can download and install it the module is here http://www.dlestarter.com/downloads/modules/13-3news.html

@ KingOfDCP, I have go back to check and test it, all versions I mentioned above are working fine with 3news...

Also I have mentioned in the post:
The best part is, you can add anything you want in this file like banner, ads, google search box or whatever you want here...so feel free to suite up yourself...
which means you can even use custom page using {custom} and {include} or use ads or anything...
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
Gozan
Gozan
V.I.P.
Commented By Gozan on January 5, 2012 (11:12 am)
so sweet from u tben to resolve my problem with nice hack hug_big

without installing that module 3news feel

you work always under shadow,you`ve a pure heart cvetok
you must tell me what you do for me sad
33 132Forum topics : 20Forum replies : 88Forum likes : 7
ivanov16
ivanov16
V.I.P.
Commented By ivanov16 on April 6, 2012 (1:54 pm)
It's not work with dle 9.5 sad
N/A 60Forum topics : 27Forum replies : 106Forum likes : 1
Gozan
Gozan
V.I.P.
Commented By Gozan on April 6, 2012 (2:53 pm)
work with me on 9.5, but with high space
33 132Forum topics : 20Forum replies : 88Forum likes : 7
ivanov16
ivanov16
V.I.P.
Commented By ivanov16 on April 6, 2012 (3:32 pm)
Gozan,
My site installed 3news but I have problem like you

sp
N/A 60Forum topics : 27Forum replies : 106Forum likes : 1
spamhater
spamhater
DLE TEAM
Commented By spamhater on April 6, 2012 (5:02 pm)
ivanov16,
the demo is 9.5 (GStarter Theme) http://themes.dlestarter.com/documents/

ivanov16,
The hack required 3News Module installation otherwise you will only get tags {top_news}, {last_news}, {rand_news}

Follow the instruction in the module installation because if you get the tag that means your site don't install 3News module
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
ivanov16
ivanov16
V.I.P.
Commented By ivanov16 on April 6, 2012 (6:03 pm)
spamhater,
No, module installed but i dont understand it works only at main page no

paste tags to full_story,... it dont show prostite
N/A 60Forum topics : 27Forum replies : 106Forum likes : 1
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on April 6, 2012 (6:48 pm)
oh no...the module applied to main.tpl (including file included) and info.tpl only...it will not work in fullstory.tpl so you can't use in in fullstory.
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
ivanov16
ivanov16
V.I.P.
Commented By ivanov16 on April 6, 2012 (7:02 pm)
sawanbanna,
Hi sawanbanna,
I know, I want to test with another page

step by step:
- Installed 3news module
- Copy "sawanbanna code" and paste to info.tpl

wink
N/A 60Forum topics : 27Forum replies : 106Forum likes : 1
Gozan
Gozan
V.I.P.
Commented By Gozan on April 6, 2012 (8:14 pm)
ivanov16,
try this one as i did

1- follow all steps from 3news module except not insert the code in main.tpl.

2- add 404 code above in info.tpl
33 132Forum topics : 20Forum replies : 88Forum likes : 7
ivanov16
ivanov16
V.I.P.
Commented By ivanov16 on April 7, 2012 (4:03 am)
Work fine. Thanks sawanbanna clap
N/A 60Forum topics : 27Forum replies : 106Forum likes : 1
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on April 7, 2012 (8:55 pm)
ivanov16,
I have no idea man...I just tested on theme Alltuts in demo site http://themes.dlestarter.com/documents/ change the theme to Alltuts
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
Gozan
Gozan
V.I.P.
Commented By Gozan on April 8, 2012 (6:27 am)
sawanbanna,

so me i sawan!!
look to my 404
scrolldown and u will find my module in the hell confused

what`s problem!!
33 132Forum topics : 20Forum replies : 88Forum likes : 7
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on April 8, 2012 (4:15 pm)
Gozan,
open info.tpl replace your 3news code with this:
[not-aviable=userinfo|pm|main|showfull]
<div style="display:block;overflow:hidden">
<div style="clear:both"></div>
<ul style="margin:0; padding:0; display:block;">
<li style="width:33%; display:inline; float:left; padding:0; margin:0">
<h3>Latest News</h3>
<ul class="newslist">{last_news}</ul>
</li>
<li style="width:33%; display:inline; float:left; padding:0; margin:0">
<h3>Top News</h3>
<ul class="newslist">{top_news}</ul>
</li>
<li style="width:33%; display:inline; float:left; padding:0; margin:0">
<h3>Recommend News</h3>
<ul class="newslist">{rand_news}</ul>
</li>
</ul>
<div style="clear:both"></div>
</div>
[/not-aviable]


Detail Note: simply wrap the code with:
<div style="display:block;overflow:hidden">
...
...
</div>
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
steven
steven
V.I.P.
Commented By steven on April 12, 2012 (7:51 am)
Hi all, a little addition to this error thing!
Say a link is death i don't want to show them the 404 with additional info just yet!
So i had a look and here is what i came up with
in /modules/show.full.php
Look for:

@header( "HTTP/1.0 404 Not Found" );
msgbox( $lang['all_err_1'], $lang['news_err_12'] );

And replace with

if(isset($_GET['seourl']) AND $_GET['seourl'] != ''){
      $_GET['seourl'] = str_replace('-','+',$_GET['seourl']);	
      @header( 'Location: /index.php?do=search&subaction=search&story='.$_GET['seourl']);
} else {
      @header( "HTTP/1.0 404 Not Found" );
      msgbox( $lang['all_err_1'], $lang['news_err_12'] );
}

Basically if the news was not found it will search for the string of the deleted news so it gives an extra chance to find something a little more useful if it doesn't find anything it will still show the above!
Also this happens only if seo url is on and not empty string! double triple chances
3 22Forum topics : 6Forum replies : 123Forum likes : 5

<?php
echo base64_decode("WW91IGdvdCBtb25leT8=");
spamhater
spamhater
DLE TEAM
Commented By spamhater on April 12, 2012 (2:21 pm)
nice hack steven...I like it man...thanks.
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
ivanov16
ivanov16
V.I.P.
Commented By ivanov16 on April 12, 2012 (3:05 pm)
Nice hack steven :) but I cant enjoy it recourse
N/A 60Forum topics : 27Forum replies : 106Forum likes : 1
steven
steven
V.I.P.
Commented By steven on April 12, 2012 (7:10 pm)
ivanov16,
Can't enjoy it Why?
3 22Forum topics : 6Forum replies : 123Forum likes : 5

<?php
echo base64_decode("WW91IGdvdCBtb25leT8=");
ivanov16
ivanov16
V.I.P.
Commented By ivanov16 on April 13, 2012 (11:20 am)
steven,
Because it's not work with my site (dle 9.5)

please see my reply above
N/A 60Forum topics : 27Forum replies : 106Forum likes : 1
spamhater
spamhater
DLE TEAM
Commented By spamhater on April 13, 2012 (7:03 pm)
ivanov16,
Open index.php Find and Remove
require_once ROOT_DIR.'/engine/modules/3news.php';

Open /engine/init.php Find
if ($config['allow_tags']) include_once ENGINE_DIR . '/modules/tagscloud.php';

Add below:
require_once ROOT_DIR.'/engine/modules/3news.php';

I have updated the install instruction...

let me know if it works...
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
ivanov16
ivanov16
V.I.P.
Commented By ivanov16 on April 14, 2012 (7:35 pm)
spamhater,
Great!!! Work fine clap

Thank You so much!
N/A 60Forum topics : 27Forum replies : 106Forum likes : 1
steven
steven
V.I.P.
Commented By steven on April 18, 2012 (4:05 am)
my hack works whether or not you have 3news installed!!!
3 22Forum topics : 6Forum replies : 123Forum likes : 5

<?php
echo base64_decode("WW91IGdvdCBtb25leT8=");
ivanov16
ivanov16
V.I.P.
Commented By ivanov16 on June 18, 2012 (6:17 am)
Hello All, I do not understand the problem

Group: Guests can access error page but Group: Members can't?

Ooops, Error!
Members Sorry, you are not authorized to access to this page.
N/A 60Forum topics : 27Forum replies : 106Forum likes : 1
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on June 19, 2012 (6:22 pm)
what's your info.tpl code look like? because the 3news module has nothing to do with your group permission in your site...it maybe your html or missing css or div without closing
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
Information!Would you like to leave your comment? Please Login to your account to leave comments. Don't have an account? You can create a free account now.
DLEStarter Notice!Please note...Every hack and every module will get additional queries from your database and some hacks and some modules may result your server overload, so install only what you "need", remove any hacks and modules from your script when you don't need them, all hacks and modules appears in this website are not guaranteed by DLEStarter Team for your script security and compatibility, please read instruction carefully and use hacks and modules at your own risk...Thank you.