Dragonfly CMS logo Server sponsored and hosted by
DedicatedNOW
CVS logo  
.:: Home :: Dev. Resources :: Forums ::.
Dragonfly CMS CVS Repository
 Location: / cvs / html / includes / functions / messagebox.php
This is a web interface to the Dragonfly CMS CVS tree. You can browse the file hierarchy by picking directories. If you pick a file, you will see the revision history for that file.
Selecting a revision number will show that revision of the file. There are links at each revision to display diffs, annotate and download.
Note: Info about CVS and our commits can be found at our CVS Info Forum
File name: html/includes/functions/messagebox.php
Revision : 9.1 (9 years 3 months 1 weeks 5 days 3 hours 1 minutes 12 seconds ago) by djmaze
Changed : +4 -4 lines
Comment: Had to rewrite decode_bbcode() for proper html parsing
Due to that decode_bbcode(set_smilies()) didn't work anymore and had to be changed to set_smilies(decode_bbcode()) or even better now do everyhing at once properly using decode_bb_all()


# Author Rev Line
1 djmaze 1.1 <?php
2 djmaze 1.1 /*********************************************
3 djmaze 1.1 CPG-NUKE: Advanced Content Management System
4 djmaze 1.1 ********************************************
5 trevor 1.10 Copyright (c) 2004 by CPG-Nuke Dev Team
6 trevor 1.10 http://www.cpgnuke.com
7 djmaze 1.1  
8 trevor 1.8 CPG-Nuke is released under the terms and conditions
9 djmaze 8.4 of the GNU GPL version 2 or any later version
10 djmaze 1.1  
11 djmaze 1.15 $Source: /cvs/html/includes/functions/messagebox.php,v $
12 djmaze 9.1 $Revision: 9.0 $
13 djmaze 9.1 $Author: djmaze $
14 djmaze 9.1 $Date: 2005/01/12 03:32:37 $
15 djmaze 1.1  
16 djmaze 1.14 ***********************************************************************/
17 trevor 8.7 if (!defined('CPG_NUKE')) { exit; }
18 djmaze 1.1  
19 djmaze 1.1 function message_box() {
20 djmaze 1.4 global $bgcolor1, $bgcolor2, $textcolor2, $prefix, $multilingual, $currentlang, $db, $userinfo;
21 trevor 1.7  
22 trevor 1.13 require_once('includes/nbbcode.php');
23 trevor 1.13  
24 djmaze 8.1 $query = ($multilingual) ? "AND (mlanguage='$currentlang' OR mlanguage='')" : '';
25 djmaze 8.1 if (!is_admin()) {
26 djmaze 8.3 if (is_user()) { $query .= ' AND view!=2 AND view!=3'; }
27 djmaze 8.3 else { $query .= ' AND (view=0 OR view=3)'; }
28 djmaze 8.1 }
29 djmaze 8.1 $result = $db->sql_query('SELECT mid, title, content, date, expire, view FROM '.$prefix."_message WHERE active='1' $query", false, __FILE__);
30 djmaze 8.1 while (list($mid, $title, $content, $date, $expire, $view) = $db->sql_fetchrow($result)) {
31 djmaze 9.1 $content = decode_bb_all($content, 1);
32 djmaze 8.1 if (!empty($title) && !empty($content)) {
33 djmaze 8.1 $output = '';
34 djmaze 8.1 if ($view == 0) {
35 djmaze 8.1 $output = _MVIEWALL;
36 djmaze 8.1 } elseif ($view == 1) {
37 djmaze 8.1 $output = _MVIEWUSERS;
38 djmaze 8.1 } elseif ($view == 2) {
39 djmaze 8.1 $output = _MVIEWADMIN;
40 djmaze 8.1 } elseif ($view == 3) {
41 djmaze 8.1 $output = _MVIEWANON;
42 djmaze 8.1 } elseif ($view > 3 && (in_group($view - 3) || is_admin())) { // <= phpBB User Groups Integration
43 djmaze 8.1 $view = $view - 3;
44 djmaze 8.6 if (!in_group($view)) list($output) = $db->sql_ufetchrow("SELECT group_name FROM ".$prefix."_bbgroups WHERE group_id='$view'", SQL_NUM, __FILE__);
45 djmaze 8.1 else $output = in_group($view);
46 djmaze 8.1 }
47 djmaze 8.1 if ($output != '') {
48 djmaze 8.1 $remain = '';
49 trevor 8.7 if (can_admin()) {
50 djmaze 8.1 if ($expire == 0) {
51 djmaze 8.1 $remain = _UNLIMITED;
52 djmaze 8.1 } else {
53 djmaze 8.1 $etime = (($date+$expire)-gmtime())/3600;
54 djmaze 8.1 $etime = intval($etime);
55 djmaze 8.1 $remain = ($etime < 1) ? _EXPIRELESSHOUR : _EXPIREIN." $etime "._HOURS;
56 djmaze 8.1 }
57 djmaze 1.1 }
58 djmaze 8.1 if (THEME_USES_TPL) {
59 djmaze 8.1 global $cpgtpl;
60 djmaze 8.1 $cpgtpl->assign_block_vars('messageblock', array(
61 djmaze 8.1 'S_TITLE' => $title,
62 djmaze 8.1 'S_CONTENT' => $content,
63 djmaze 8.1 'S_OUTPUT' => $output,
64 trevor 8.7 'S_DATE' => _POSTEDON.' '.formatDateTime($date, _DATESTRING2),
65 djmaze 8.1 'S_REMAIN' => $remain,
66 djmaze 8.1 'S_EDIT' => _EDIT,
67 trevor 8.7 'U_EDITMSG' => adminlink('messages&amp;edit='.$mid)
68 djmaze 8.1 )
69 djmaze 8.1 );
70 djmaze 8.1 } else {
71 djmaze 8.1 OpenTable();
72 trevor 8.7 echo '<div class="option" style="color: '.$textcolor2.'; text-align: center;">'.$title.'</div><br /><div class="content">'.$content.'</div>';
73 trevor 8.7 if (can_admin()) {
74 trevor 8.7 echo '<div class="content" align="center"><br /><br />[ '.$output.' - '.$remain.' - <a href="'.adminlink('messages&amp;edit='.$mid).'">'._EDIT.'</a> ]</div>';
75 djmaze 1.1 }
76 djmaze 8.1 CloseTable();
77 djmaze 1.1 }
78 djmaze 8.1 }
79 djmaze 8.1 if ($expire != 0) {
80 djmaze 8.5 if ($date+$expire < gmtime()) {
81 djmaze 8.1 $db->sql_query("UPDATE ".$prefix."_message SET active='0' WHERE mid='$mid'");
82 djmaze 1.1 }
83 djmaze 1.1 }
84 djmaze 1.1 }
85 djmaze 1.1 }
86 djmaze 1.1 $db->sql_freeresult($result);
87 djmaze 8.1 }


Code Credits - Privacy Policy