Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

simple announcement panel error

Asked Modified Viewed 1,180 times
I
isz24
I
isz24 10
  • Member, joined since
  • Contributed 60 posts on the community forums.
  • Started 29 threads in the forums
  • Started this discussions
asked
Member

i just install simple announcement panel in my website...
but i got this error...

what should i do?

admin/simple_announcement_admin.php
Undefined variable: error Line: 51
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]1 <?php
2 /*-------------------------------------------------------+
3 | PHPFusion Content Management System
4 | Copyright © 2002 - 2008 Nick Jones
5 | http://www.php-fusion.co.uk/
6 +--------------------------------------------------------+
7 | Filename: announcement_admin.php
8 | CVS Version: 1.3
9 | Author: HobbyMan
10 | Web: http://www.php-fusion.hobbysites.net/
11 +--------------------------------------------------------+
12 | This program is released as free software under the
13 | Affero GPL license. You can redistribute it and/or
14 | modify it under the terms of this license which you
15 | can read by viewing the included agpl.txt or online
16 | at www.gnu.org/licenses/agpl.html. Removal of this
17 | copyright header is strictly prohibited without
18 | written permission from the original author(s).
19 +--------------------------------------------------------*/
20 require_once "../../../maincore.php";
21 require_once THEMES."templates/admin_header.php";
22 require_once INCLUDES."bbcode_include.php";
23
24 if (!checkrights("ANCP") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("../index.php"); }
25
26 if (file_exists(INFUSIONS."simple_announcement_panel/locale/".$settings['locale'].".php")) {
27 include INFUSIONS."simple_announcement_panel/locale/".$settings['locale'].".php";
28 } else {
29 include INFUSIONS."simple_announcement_panel/locale/English.php";
30 }
31
32 include INFUSIONS."simple_announcement_panel/infusion_db.php";
33
34 add_to_title($locale['global_200'].$locale['anc_201']);
35
36 if (isset($_POST['savesettings'])) {
37 $result = dbquery("UPDATE ".DB_ANNOUNCEMENT." SET
38
39 anc_user='".addslash(descript($_POST['anc_user']))."',
40 anc_import='".addslash(descript($_POST['anc_import']))."',
41 anc_subject='".addslash(descript($_POST['anc_subject']))."',
42 anc_msubject='".addslash(descript($_POST['anc_msubject']))."',
43 anc_text='".addslash(descript($_POST['anc_text']))."',
44 anc_mtext='".addslash(descript($_POST['anc_mtext']))."',
45 anc_datestamp='".(isNum($_POST['anc_datestamp']) ? $_POST['anc_datestamp'] : "0")."',
46 anc_showpd='".(isNum($_POST['anc_showpd']) ? $_POST['anc_showpd'] : "0")."',
47 anc_status='".(isNum($_POST['anc_status']) ? $_POST['anc_status'] : "0")."'
48 ");
49
50 if (!$result) { $error = 1; }
51 redirect(FUSION_SELF.$aidlink."&error=".$error);
52 }
53
54 $data = dbarray(dbquery("SELECT * FROM ".DB_ANNOUNCEMENT));
55
56 $version = $locale['anc_224'].$data['anc_version'];
57
58 opentable($locale['anc_200'].$locale['anc_213'].$version);
59
60 echo "<form name='announce' method='post' action='".FUSION_SELF.$aidlink."'>n";
61
62 echo "<table align='center' cellpadding='0' cellspacing='0' width='90%'><tr><td colspan='3' align='left'><b>".$locale['anc_201']."</b><br /><br
/></td></tr>n";
63
64 echo "<tr><td width='40%'class='tbl2' align='right' valign='top'><b>".$locale['anc_003']."</b></td>";
65 echo "<td class='tbl2' align='left' colspan='2'>";
66 echo "<select name='anc_import' class='textbox'>
67 <option value=''".($data['anc_import'] == "0" ? " selected" : "").">".$locale['anc_212']."</option>
68 <option value='".$locale['anc_207']."'".($data['anc_import'] == "".$locale['anc_207']."" ? " selected" : "").">".$locale['anc_207']."</option>
69 <option value='".$locale['anc_208']."'".($data['anc_import'] == "".$locale['anc_208']."" ? " selected" : "").">".$locale['anc_208']."</option>
70 <option value='".$locale['anc_209']."'".($data['anc_import'] == "".$locale['anc_209']."" ? " selected" : "").">".$locale['anc_209']."</option>
71 <option value='".$locale['anc_210']."'".($data['anc_import'] == "".$locale['anc_210']."" ? " selected" : "").">".$locale['anc_210']."</option>
72 <option value='".$locale['anc_211']."'".($data['anc_import'] == "".$locale['anc_211']."" ? " selected" : "").">".$locale['anc_211']."</option>
73 </select>n";
74 echo "</td></tr>";
75
76 echo "<tr><td colspan='3'><hr></td></tr>";
77
78 echo "<tr><td width='40%'class='tbl2' align='right'><b>".$locale['anc_004']."</b></td>";
79 echo "<td class='tbl2' align='left' width='60%' colspan='2'>";
80 echo "<input type='text' name='anc_subject' value='".$data['anc_subject']."' maxlength='32' class='textbox' style='width:230px;' /><br />";
81 echo "</td></tr>";
82
83 echo "<tr><td width='40%'class='tbl2' align='right' valign='top'><b>".$locale['anc_005']."</b></td><td class='tbl2' align='left' width='60%'
colspan='2'>";
84 echo "<textarea name='anc_text' rows='6' cols='44' class='textbox' style='width:400px;' />".stripslashes($data['anc_text'])."</textarea><br />";
85 echo display_bbcodes("340px", "anc_text", "announce", "smiley|b|i|u|left|center|small|url|img|color|bcolor")."n";
86 echo "</td></tr>";
87
88 echo "<tr><td colspan='3'><hr></td></tr>";
89
90 echo "<tr><td width='40%'class='tbl2' align='right'><b>".$locale['anc_004']."</b></td>";
91 echo "<td class='tbl2' align='left' width='60%' colspan='2'>";
92 echo "<input type='text' name='anc_msubject' value='".$data['anc_msubject']."' maxlength='32' class='textbox' style='width:230px;' /><br />";
93 echo "</td></tr>";
94
95 echo "<tr><td width='40%'class='tbl2' align='right' valign='top'><b>".$locale['anc_006']."</b></td><td class='tbl2' align='left' width='60%'
colspan='2'>";
96 echo "<textarea name='anc_mtext' rows='6' cols='44' class='textbox' style='width:400px;' />".stripslashes($data['anc_mtext'])."</textarea><br
/>";
97 echo display_bbcodes("340px", "anc_mtext", "announce", "smiley|b|i|u|left|center|small|url|img|color|bcolor")."n";
98 echo "</td></tr>";
99
100 echo "<tr><td colspan='3'><hr></td></tr>";
101
102 echo "<tr><td width='40%'class='tbl2' align='right'><b>".$locale['anc_204']."</b><td class='tbl2' align='left' width='60%' colspan='2'>";
103 echo "<b>".$userdata['user_name']."</b><input type='hidden' name='anc_user' value='".$userdata['user_name']."' class='textbox' />";
104 echo "</td></tr>";
105
106 echo "<tr><td width='30%'class='tbl2' align='right'><b>".$locale['anc_205']."</b></td><td class='tbl2' align='left' width='30%'>";
107 echo "<input type='hidden' name='anc_datestamp' value='".time()."' class='textbox' />".strftime('%d/%m/%Y',
$data['anc_datestamp']+($settings['timeoffset']*3600))."</td>";
108 echo "<td class='tbl2' align='left' width='30%'><input type='submit' name='savesettings' value='".$locale['anc_206']."' class='panelbutton'>";
109 echo "</td></tr>";
110
111 if ($data['anc_showpd'] == 0)
112 {
113 $showpd = $locale['anc_221'];
114 } else {
115 $showpd = $locale['anc_220'];
116 }
117
118 echo "<tr><td width='40%' class='tbl2' align='right'><div class='small'>".$locale['anc_214']."</div><td class='tbl2' align='left' width='60%'
colspan='2'>";
119 echo "<div class='small'><label><input type='radio' name='anc_showpd' value='1'".($data['anc_showpd'] == "1" ? " checked='checked'" : "")."
/>&nbsp;".$locale['anc_215']."</label>";
120 echo "&nbsp;<label><input type='radio' name='anc_showpd' value='0'".($data['anc_showpd'] == "0" ? " checked='checked'" : "")."
/>&nbsp;".$locale['anc_216']."</label>&nbsp;[<b>".$showpd."</b>]</div>";
121 echo "</td></tr>";
122
123 if ($data['anc_status'] == 0)
124 {
125 $show = $locale['anc_219'];
126 } else {
127 $show = $locale['anc_218'];
128 }
129
130 echo "<tr><td width='40%' class='tbl2' align='right' valign='top'><div class='small'>".$locale['anc_217']."</div><td class='tbl2' align='left'
width='60%' colspan='2'>";
131 echo "<div class='small'><label><input type='radio' name='anc_status' value='1'".($data['anc_status'] == "1" ? " checked='checked'" : "")."
/>&nbsp;".$locale['anc_215']."</label>";
132 echo "&nbsp;<label><input type='radio' name='anc_status' value='0'".($data['anc_status'] == "0" ? " checked='checked'" : "")."
/>&nbsp;".$locale['anc_216']."</label>&nbsp;[<b>".$show."</b>]</div>";
133 echo "<br /></td></tr>";
134
135 echo "<tr><td colspan='3' align='center'>";
136 echo "<br /><input type='submit' name='savesettings' value='".$locale['anc_203']."' class='button'>";
137 echo "</td></tr>n</table>n</form>n";
138
139 echo "<br /><br />";
140
141 closetable();
142
143 //Preview
144
145 echo "<u><b>".$locale['anc_222']."</b></u><br /><div class='small'>".$locale['anc_223']."</div><br />";
146
147 $datapr = dbarray(dbquery("SELECT * FROM ".DB_ANNOUNCEMENT));
148
149 if ($datapr['anc_status'] == 0) {
150 $title = "";
151 } else {
152 $title = "".$locale['anc_213'].$datapr['anc_import']."";
153 }
154
155 opentable($locale['anc_001'].$title);
156
157 if ($datapr['anc_text'])
158 {
159 echo "<table align='center' cellpadding='0' cellspacing='0' width='90%' border='0'>n";
160 echo "<tr><td class='small'>";
161 echo "<b><i>".$locale['anc_005']."</i></b>";
162 echo "<br /><br />";
163 echo "<b>".$datapr['anc_subject']."</b>";
164 echo "<br />";
165 $anc_text = phpentities(stripslashes($datapr['anc_text']));
166 echo "".nl2br(parseubb(parsesmileys($anc_text)))."<br />";
167 echo "</td></tr>";
168 echo "</table>";
169 echo "<hr>";
170
171 } else {
172 echo "<b><i>".$locale['anc_005']."</i></b>";
173 echo "<br /><br />";
174 echo "<div style='text-align:center' class='small'>".$locale['anc_400']."</div><hr>n";
175 }
176
177
178 if ($datapr['anc_mtext'])
179 {
180 echo "<table align='center' cellpadding='0' cellspacing='0' width='90%' border='0'>n";
181 echo "<tr><td class='small'>";
182 echo "<hr>";
183 echo "<b><i>".$locale['anc_006']."</i></b>";
184 echo "<br /><br />";
185 echo "<b>".$datapr['anc_msubject']."</b>";
186 echo "<br />";
187 $anc_mtext = phpentities(stripslashes($datapr['anc_mtext']));
188 echo "".nl2br(parseubb(parsesmileys($anc_mtext)))."<br />";
189 echo "</td></tr>";
190 echo "</table>";
191 echo "<hr>";
192
193 } else {
194 echo "<b><i>".$locale['anc_006']."</i></b>";
195 echo "<br /><br />";
196 echo "<div style='text-align:center' class='small'>".$locale['anc_400']."</div><hr>n";
197 }
198
199 // Please do not remove copyright
200 echo "<br /><br />";
201 echo "<div class='tbl2'><div class='small' align='center'>".$locale['anc_002']." ".$version." &copy; <a target='_blank'
href='http://www.php-fusion.hobbysites.net'>HobbySites.net</a> ".date("Y")."<br /></div></div>n";
202 closetable();
203
204 require_once THEMES."templates/footer.php";
205 ?>[/syntaxhighlighter]
Edited by HobbyMan on 22-05-2011 11:49,
0 replies

2 posts

S
SiteMaster
S
If i have touched it, it's W3C Valid
  • Senior Member, joined since
  • Contributed 305 posts on the community forums.
  • Started 15 threads in the forums
answered
Senior Member

change line 50

from
if (!$result) { $error = 1; }


to
if (!$result) { $error = 1; } else { $error = ""; }
0 replies
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
answered
Veteran Member

This is one of my Addons and it is need of some updating. I've been too busy to get around to it.
0 replies

Category Forum

Panels and Infusions

Labels

None yet

Statistics

  • Views 0 views
  • Posts 2 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

H
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
S
S
If i have touched it, it's W3C Valid
  • Senior Member, joined since
  • Contributed 305 posts on the community forums.
  • Started 15 threads in the forums
I
I
isz24 10
  • Member, joined since
  • Contributed 60 posts on the community forums.
  • Started 29 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet