Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2496

PostPosted: Sun Jan 09, 2005 2:43 pm Reply with quote

I didn't like the bland look of the admin messages so I added some borders around them. Can preview at Only registered users can see links on this board! Get registered or login!

In mainfile.php find function message_box()
Here is my code from 7.6 it will give you an idea of what to change even if you don't use 7.6 or like the format I used. Mileage may vary...

Code:


function message_box() {
        global $bgcolor1, $bgcolor2, $bgcolor3, $user, $admin, $cookie, $textcolor2, $prefix, $multilingual, $currentlang, $db, $admin_file;
        if ($multilingual == 1) {
            $querylang = "AND (mlanguage='$currentlang' OR mlanguage='')";
        } else {
            $querylang = "";
        }
        $result = $db->sql_query("SELECT mid, title, content, date, expire, view FROM ".$prefix."_message WHERE active='1' $querylang");
        if ($numrows = $db->sql_numrows($result) == 0) {
            return;
        } else {
            while ($row = $db->sql_fetchrow($result)) {
                $mid = intval($row['mid']);
                $title = stripslashes(check_html($row['title'], "nohtml"));
                $content = stripslashes($row['content']);
                $mdate = $row['date'];
                $expire = intval($row['expire']);
                $view = intval($row['view']);
                if ($title != "" && $content != "") {
                    if ($expire == 0) {
                        $remain = _UNLIMITED;
                    } else {
                        $etime = (($mdate+$expire)-time())/3600;
                        $etime = (int)$etime;
                        if ($etime < 1) {
                            $remain = _EXPIRELESSHOUR;
                        } else {
                            $remain = ""._EXPIREIN." $etime "._HOURS."";
                        }
                    }
                    if ($view == 5 AND paid()) {
                         
                        echo "<table border=\"2\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=\"000000\" width=\"100%\"><tr><td><table border=\"2\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\"><tr><td bgcolor=\"$bgcolor3\">";
                        echo "<center><font class=\"option\" color=\"$textcolor2\"><b>$title</b></font></center><br /><font class=\"content\">$content<br /></font>";
                        echo "</td></tr>";
                        if (is_admin($admin)) {
                            echo "<tr><td bgcolor=\"$bgcolor2\" align=\"right\"><font class=\"content\"><center><font class=\"content\">[ "._MVIEWSUBUSERS." - $remain - <a href=\"".$admin_file.".php?op=editmsg&mid=$mid\">"._EDIT."</a> ]</font></center></td></tr>";
                        }
                        echo "</table></td></tr></table><br />";
                    } elseif ($view == 4 AND is_admin($admin)) {
                         
                        echo "<table border=\"2\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=\"000000\" width=\"100%\"><tr><td><table border=\"2\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\"><tr><td bgcolor=\"$bgcolor3\">";
                        echo "<center><font class=\"option\" color=\"$textcolor2\"><b>$title</b></font></center><br /><font class=\"content\">$content<br /></font>";
                        echo "</td></tr>";
                        if (is_admin($admin)) {
                            echo "<tr><td bgcolor=\"$bgcolor2\" align=\"right\"><font class=\"content\"><center><font class=\"content\">[ "._MVIEWSUBUSERS." - $remain - <a href=\"".$admin_file.".php?op=editmsg&mid=$mid\">"._EDIT."</a> ]</font></center></td></tr>";
                        }
                        echo "</table></td></tr></table><br />";
                    } elseif ($view == 3 AND is_user($user) || is_admin($admin)) {
                         
                        echo "<table border=\"2\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=\"000000\" width=\"100%\"><tr><td><table border=\"2\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\"><tr><td bgcolor=\"$bgcolor3\">";
                        echo "<center><font class=\"option\" color=\"$textcolor2\"><b>$title</b></font></center><br /><font class=\"content\">$content<br /></font>";
                        echo "</td></tr>";
                        if (is_admin($admin)) {
                            echo "<tr><td bgcolor=\"$bgcolor2\" align=\"right\"><font class=\"content\"><center><font class=\"content\">[ "._MVIEWUSERS." - $remain - <a href=\"".$admin_file.".php?op=editmsg&mid=$mid\">"._EDIT."</a> ]</font></center></td></tr>";
                        }
                        echo "</table></td></tr></table><br />";
                    } elseif ($view == 2 AND !is_user($user) || is_admin($admin)) {
                         
                        echo "<table border=\"2\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=\"000000\" width=\"100%\"><tr><td><table border=\"2\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\"><tr><td bgcolor=\"$bgcolor3\">";
                        echo "<center><font class=\"option\" color=\"$textcolor2\"><b>$title</b></font></center><br /><font class=\"content\">$content<br /></font>";
                        echo "</td></tr>";
                        if (is_admin($admin)) {
                            echo "<tr><td bgcolor=\"$bgcolor2\" align=\"right\"><font class=\"content\"><center><font class=\"content\">[ "._MVIEWANON." - $remain - <a href=\"".$admin_file.".php?op=editmsg&mid=$mid\">"._EDIT."</a> ]</font></center></td></tr>";
                        }
                        echo "</table></td></tr></table><br />";
                    } elseif ($view == 1) {
                         
                        echo "<table border=\"2\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=\"000000\" width=\"100%\"><tr><td><table border=\"2\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\"><tr><td bgcolor=\"$bgcolor3\">";
                        echo "<center><font class=\"option\" color=\"$textcolor2\"><b>$title</b></font></center><br /><font class=\"content\">$content<br /></font>";
                        echo "</td></tr>";
                        if (is_admin($admin)) {
                            echo "<tr><td bgcolor=\"$bgcolor2\" align=\"right\"><font class=\"content\"><center><font class=\"content\">[ "._MVIEWALL." - $remain - <a href=\"".$admin_file.".php?op=editmsg&mid=$mid\">"._EDIT."</a> ]</font></center></td></tr>";
                        }
                        echo "</table></td></tr></table><br />";
                    }
                    if ($expire != 0) {
                        $past = time()-$expire;
                        if ($mdate < $past) {
                            $db->sql_query("UPDATE ".$prefix."_message SET active='0' WHERE mid='$mid'");
                        }
                    }
                }
            }
        }
    }

_________________
[b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©