Changeset 1754
- Timestamp:
- 09/20/2008 07:29:43 PM (4 months ago)
- Location:
- branches/1.5/lib
- Files:
-
- 4 added
- 10 modified
- 2 moved
-
Jlog/Bbcode.php (modified) (5 diffs)
-
Jlog/Categories.php (modified) (9 diffs)
-
Jlog/Comments.php (modified) (8 diffs)
-
Jlog/Db.php (modified) (3 diffs)
-
Jlog/Db/Query.php (modified) (1 diff)
-
Jlog/Feeds.php (modified) (4 diffs)
-
Jlog/Functions.php (modified) (6 diffs)
-
Jlog/Language.php (added)
-
Jlog/Plugin (added)
-
Jlog/Plugin/Basic.php (added)
-
Jlog/Plugin/Manager.php (moved) (moved from branches/1.5/lib/Jlog/Plugins.php) (2 diffs)
-
Jlog/Update.php (modified) (2 diffs)
-
Jlog/YearLinks.php (modified) (3 diffs)
-
Pear (added)
-
Pear/HttpRequest.php (moved) (moved from branches/1.5/lib/Jlog/HttpRequest.php)
-
bootstrap.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.5/lib/Jlog/Bbcode.php
r1753 r1754 71 71 else return true; 72 72 } 73 $title = empty($attributes["title"]) ? "" : " title='".$attributes["title"]."'";73 $title = empty($attributes["title"]) ? "" : " title='".$attributes["title"]."'"; 74 74 75 75 if (isset($attributes['class']) AND isset($attributes['caption'])) $class_caption = " class='img ".htmlspecialchars($attributes['class'])."'"; … … 99 99 100 100 $bbcode = new StringParser_BBCode (); 101 $bbcode->addFilter (STRINGPARSER_FILTER_PRE, 'convertlinebreaks');102 $bbcode->addFilter (STRINGPARSER_FILTER_POST, 'special_character');101 $bbcode->addFilter (STRINGPARSER_FILTER_PRE, array(&$this, 'convertlinebreaks')); 102 $bbcode->addFilter (STRINGPARSER_FILTER_POST, array(&$this, 'special_character')); 103 103 104 104 $bbcode->addParser (array ('block', 'inline', 'link', 'listitem'), 'htmlspecialchars'); … … 119 119 'block', array('block', 'listitem'), array('inline', 'link')); 120 120 121 $bbcode->addCode ('url', 'usecontent?', array( $this, 'do_bbcode_url'), array ('usecontent_param' => 'default'),121 $bbcode->addCode ('url', 'usecontent?', array(&$this, 'do_bbcode_url'), array ('usecontent_param' => 'default'), 122 122 'link', array ('listitem', 'block', 'inline'), array ('link')); 123 123 124 $bbcode->addCode ('img', 'usecontent', array( $this, 'do_bbcode_img'), array (),124 $bbcode->addCode ('img', 'usecontent', array(&$this, 'do_bbcode_img'), array (), 125 125 'image', array ('listitem', 'block', 'inline', 'link'), array ()); 126 126 127 $bbcode->addCode ('html', 'usecontent', array( $this, 'do_bbcode_html'), array (),127 $bbcode->addCode ('html', 'usecontent', array(&$this, 'do_bbcode_html'), array (), 128 128 'html', array ('listitem', 'block', 'inline', 'link'), array ('image')); 129 129 … … 165 165 // BBCode for comments 166 166 $bbcomments = new StringParser_BBCode (); 167 $bbcomments->addFilter (STRINGPARSER_FILTER_PRE, 'convertlinebreaks');168 $bbcomments->addFilter (STRINGPARSER_FILTER_POST, 'special_character');167 $bbcomments->addFilter (STRINGPARSER_FILTER_PRE, array(&$this, 'convertlinebreaks')); 168 $bbcomments->addFilter (STRINGPARSER_FILTER_POST, array(&$this, 'special_character')); 169 169 170 170 $bbcomments->addParser (array ('block', 'inline', 'link'), 'htmlspecialchars'); … … 176 176 $bbcomments->addCode ('i', 'simple_replace', null, array ('start_tag' => '<em>', 'end_tag' => '</em>'), 177 177 'inline', array ('block', 'inline', 'link'), array ()); 178 $bbcomments->addCode ('url', 'usecontent?', array( $this, 'do_bbcode_url'), array ('usecontent_param' => 'default'),178 $bbcomments->addCode ('url', 'usecontent?', array(&$this, 'do_bbcode_url'), array ('usecontent_param' => 'default'), 179 179 'link', array ('block', 'inline'), array ('link')); 180 180 $bbcomments->addCode ('quote', 'simple_replace', null, array('start_tag' => '<blockquote>', 'end_tag' => '</blockquote>'), -
branches/1.5/lib/Jlog/Categories.php
r1753 r1754 6 6 7 7 var $categories = array(); 8 var $l = array(); 9 10 function Categories($l) { 11 $this->l = $l; 8 var $l = null; 9 10 function Jlog_Categories() { 11 global $JLOG; 12 $this->l = &$JLOG['language']; 12 13 13 14 $this->get_categories(); … … 74 75 75 76 if(count($this->categories) > 0) { 76 $output = " <p><label for='categories'>".$this->l ['admin']['categories']."</label><br />\n"77 $output = " <p><label for='categories'>".$this->l->_('admin.categories')."</label><br />\n" 77 78 ." <select id='categories' name='categories[]' size='4' multiple='multiple'>\n" 78 ." <option value='no_categories'>".$this->l ['admin']['no_categories']."</option>\n";79 ." <option value='no_categories'>".$this->l->_('admin.no_categories')."</option>\n"; 79 80 80 81 foreach($this->categories AS $id => $data) { … … 107 108 } 108 109 } 109 if(isset($output)) return " <span title='".$this->l ['content_cat_linklist']."' class='catlinklist'>» ".$output."</span>";110 if(isset($output)) return " <span title='".$this->l->_('content_cat_linklist')."' class='catlinklist'>» ".$output."</span>"; 110 111 } 111 112 … … 123 124 124 125 function link($id) { 125 if(JLOG_CLEAN_URL) return "<a title='".$this->l ['content_cat_link']."' href='".JLOG_PATH."/cat/".$this->categories[$id]['url']."/'>".$this->categories[$id]['name']."</a>";126 else return "<a title='".$this->l ['content_cat_link']."' href='".JLOG_PATH."/archive.php?cat=".$this->categories[$id]['url']."'>".$this->categories[$id]['name']."</a>";126 if(JLOG_CLEAN_URL) return "<a title='".$this->l->_('content_cat_link')."' href='".JLOG_PATH."/cat/".$this->categories[$id]['url']."/'>".$this->categories[$id]['name']."</a>"; 127 else return "<a title='".$this->l->_('content_cat_link')."' href='".JLOG_PATH."/archive.php?cat=".$this->categories[$id]['url']."'>".$this->categories[$id]['name']."</a>"; 127 128 } 128 129 … … 131 132 <table> 132 133 <tr> 133 <th>".$this->l ['admin']['change']."</th>134 <th>".$this->l ['admin']['delete']."</th>135 <th>".$this->l ['admin']['cat_name']."</th>134 <th>".$this->l->_('admin.change')."</th> 135 <th>".$this->l->_('admin.delete')."</th> 136 <th>".$this->l->_('admin.cat_name')."</th> 136 137 </tr>"; 137 138 … … 139 140 $output .= " 140 141 <tr> 141 <td><a href='".add_session_id_to_url("?action=change&id=".$id)."'><img src='".JLOG_PATH."/img/JLOG_edit.png' alt='".$this->l ['admin']['change']."' /></a></td>142 <td><a href='".add_session_id_to_url("?action=trash&id=".$id)."'><img src='".JLOG_PATH."/img/JLOG_trash.png' alt='".$this->l ['admin']['delete']."' /></a></td>142 <td><a href='".add_session_id_to_url("?action=change&id=".$id)."'><img src='".JLOG_PATH."/img/JLOG_edit.png' alt='".$this->l->_('admin.change')."' /></a></td> 143 <td><a href='".add_session_id_to_url("?action=trash&id=".$id)."'><img src='".JLOG_PATH."/img/JLOG_trash.png' alt='".$this->l->_('admin.delete')."' /></a></td> 143 144 <td>".$this->link($id)."</td> 144 145 </tr>\n"; … … 154 155 <form id='entryform' action='?action=".$action."' method='POST'> 155 156 <fieldset><legend>".$legend."</legend> 156 <p><label for='name'>".$this->l ['admin']['cat_name']."</label><br />157 <p><label for='name'>".$this->l->_('admin.cat_name')."</label><br /> 157 158 <input id='name' name='name' class='long' maxlength='255' size='60' type='text' value='".$form_input['name']."' /></p> 158 <p><label for='url'>".$this->l ['admin']['cat_url']."</label><br />159 <p><label for='url'>".$this->l->_('admin.cat_url')."</label><br /> 159 160 <input id='url' name='url' class='long' maxlength='100' size='60' type='text' value='".$form_input['url']."' /> 160 161 <input name='id' type='hidden' value='".$form_input['id']."' /></p> 161 <p><label for='description'>".$this->l ['admin']['cat_description']."</label><br />162 <p><label for='description'>".$this->l->_('admin.cat_description')."</label><br /> 162 163 <textarea id='description' name='description' class='short'>".$form_input['description']."</textarea></p> 163 <p><input type='submit' name='form_submit' value='".$this->l ['admin']['submit']."' />164 <a href='".add_session_id_to_url("categories.php")."'>".$this->l ['admin']['cancel']."</a>164 <p><input type='submit' name='form_submit' value='".$this->l->_('admin.submit')."' /> 165 <a href='".add_session_id_to_url("categories.php")."'>".$this->l->_('admin.cancel')."</a> 165 166 ".add_session_id_input_tag()."</p> 166 167 </fieldset> … … 235 236 236 237 function validate($form_input) { 237 if(empty($form_input['name'])) $errors[] = $this->l ['admin']['cat_noname'];238 239 if(empty($form_input['url'])) $errors[] = $this->l ['admin']['no_url'];240 elseif(!preg_match("/^[a-z0-9\-_\.,]+$/", $form_input['url'])) $errors[] = $this->l ['admin']['false_url_letters'];238 if(empty($form_input['name'])) $errors[] = $this->l->_('admin.cat_noname'); 239 240 if(empty($form_input['url'])) $errors[] = $this->l->_('admin.no_url'); 241 elseif(!preg_match("/^[a-z0-9\-_\.,]+$/", $form_input['url'])) $errors[] = $this->l->_('admin.false_url_letters'); 241 242 else { 242 243 $sql = "SELECT id FROM ".JLOG_DB_CATEGORIES." WHERE url = '".escape_for_mysql($form_input['url'])."';"; … … 253 254 if($check_url->numRows() > 0) { 254 255 $c = $check_url->fetch(); 255 if($c['id'] != $form_input['id']) $errors[] = $this->l ['admin']['cat_duplicate'];256 if($c['id'] != $form_input['id']) $errors[] = $this->l->_('admin.cat_duplicate'); 256 257 } 257 258 } -
branches/1.5/lib/Jlog/Comments.php
r1753 r1754 3 3 class Jlog_Comments 4 4 { 5 var $l = null; 6 7 function Jlog_Comments() 8 { 9 global $JLOG; 10 $this->l = &$JLOG['language']; 11 } 12 5 13 function com_form_output($com_form) { 6 global $l, $plugins;7 14 $com_form = array_htmlspecialchars($com_form); 8 15 if(!isset($com_form['content'])) $com_form['content'] = ""; … … 10 17 $output = " 11 18 <form method='post' action='#entryform' id='entryform'> 12 <fieldset><legend>".$ l['comments_entryform']."</legend>19 <fieldset><legend>".$this->l->_('comments_entryform')."</legend> 13 20 <p class='xmp'> 14 <span>".$ l['comments_bbcode']."21 <span>".$this->l->_('comments_bbcode')." 15 22 <a onclick=\"jlog_learnbb('".JLOG_PATH."'); return false;\" href='".JLOG_PATH."/learn_bb.php'>BBcode</a>? 16 23 </span> … … 20 27 <p> 21 28 <input class='userdata' type='text' name='name' value='".$com_form['name']."' 22 onfocus=\"if(this.value && this.value=='".$ l['comments_name']."')this.value=''\"23 onblur=\"if(this.value=='') this.value='".$ l['comments_name']."'\" />29 onfocus=\"if(this.value && this.value=='".$this->l->_('comments_name')."')this.value=''\" 30 onblur=\"if(this.value=='') this.value='".$this->l->_('comments_name')."'\" /> 24 31 <input class='userdata' type='text' name='city' value='".$com_form['city']."' 25 onfocus=\"if(this.value && this.value=='".$ l['comments_city']."')this.value=''\"26 onblur=\"if(this.value=='') this.value='".$ l['comments_city']."'\" /><br />32 onfocus=\"if(this.value && this.value=='".$this->l->_('comments_city')."')this.value=''\" 33 onblur=\"if(this.value=='') this.value='".$this->l->_('comments_city')."'\" /><br /> 27 34 <input class='userdata' type='text' name='email' value='".$com_form['email']."' 28 onfocus=\"if(this.value && this.value=='".$ l['comments_email']."')this.value=''\"29 onblur=\"if(this.value=='') this.value='".$ l['comments_email']."'\" />35 onfocus=\"if(this.value && this.value=='".$this->l->_('comments_email')."')this.value=''\" 36 onblur=\"if(this.value=='') this.value='".$this->l->_('comments_email')."'\" /> 30 37 <input class='userdata' type='text' name='homepage' value='".$com_form['homepage']."' /> 31 38 </p> … … 33 40 <input type='checkbox' id='mail_by_comment' name='mail_by_comment' "; 34 41 if(isset($com_form['mail_by_comment']) AND $com_form['mail_by_comment'] == 1) $output .= "checked='checked'"; 35 $output .= " value='1' /> <label for='mail_by_comment'>".$ l['comments_mail_by_comment']."</label> ";42 $output .= " value='1' /> <label for='mail_by_comment'>".$this->l->_('comments_mail_by_comment')."</label> "; 36 43 if(defined('JLOG_ADMIN')) $output .= "\n <input type='hidden' value='".$com_form['id']."' name='id' />\n"; 37 44 else { 38 45 $output .= " <input type='checkbox' id='cookie' name='cookie' "; 39 46 if(isset($com_form['cookie']) AND $com_form['cookie'] == 1) $output .= "checked='checked'"; 40 $output .= " value='1' /> <label for='cookie'>".$ l['comments_save_data']."</label>\n";47 $output .= " value='1' /> <label for='cookie'>".$this->l->_('comments_save_data')."</label>\n"; 41 48 } 42 49 $output .= " <input type='hidden' value='".$com_form['sid']."' name='sid' /> 43 50 </p> 44 51 <p> 45 <input class='send' type='submit' name='form_submitted' value='".$ l['comments_preview']."' onclick=\"this.form.action = '#preview'\" />46 <input class='send' type='submit' name='form_submitted' value='".$ l['comments_send']."' />";52 <input class='send' type='submit' name='form_submitted' value='".$this->l->_('comments_preview')."' onclick=\"this.form.action = '#preview'\" /> 53 <input class='send' type='submit' name='form_submitted' value='".$this->l->_('comments_send')."' />"; 47 54 48 55 if(defined("JLOG_ADMIN")) $output .= add_session_id_input_tag(); … … 61 68 62 69 function com_javascript_variables() { 63 global $l;64 70 return " 65 71 <script type='text/javascript'> 66 jlog_l_comments_show = '".$ l['comments_show']."';67 jlog_l_comments_hide = '".$ l['comments_hide']."';68 jlog_l_comments_bold = '".$ l['comments_bold']."';69 jlog_l_comments_italic = '".$ l['comments_italic']."';70 jlog_l_comments_quote = '".$ l['comments_quote']."';71 jlog_l_comments_url = '".$ l['comments_url']."';72 jlog_l_comments_plz_format_txt = '".$ l['comments_plz_format_txt']."';73 jlog_l_comments_url_href = '".$ l['comments_url_href']."';74 jlog_l_comments_url_node = '".$ l['comments_url_node']."';72 jlog_l_comments_show = '".$this->l->_('comments_show')."'; 73 jlog_l_comments_hide = '".$this->l->_('comments_hide')."'; 74 jlog_l_comments_bold = '".$this->l->_('comments_bold')."'; 75 jlog_l_comments_italic = '".$this->l->_('comments_italic')."'; 76 jlog_l_comments_quote = '".$this->l->_('comments_quote')."'; 77 jlog_l_comments_url = '".$this->l->_('comments_url')."'; 78 jlog_l_comments_plz_format_txt = '".$this->l->_('comments_plz_format_txt')."'; 79 jlog_l_comments_url_href = '".$this->l->_('comments_url_href')."'; 80 jlog_l_comments_url_node = '".$this->l->_('comments_url_node')."'; 75 81 </script> 76 82 "; … … 78 84 79 85 function com_check_errors($com_form) { 80 global $l; 81 if(empty($com_form['sid'])) $errors[] = $l['comments_no_sid']; 82 if(isset($com_form['email']) AND $com_form['email'] != "" AND !preg_match("/^[^@]+@.+\.\D{2,6}$/", $com_form['email']) AND $com_form['email'] != $l['comments_email']) $errors[] = $l['comments_false_mail']; 83 if(empty($com_form['content'])) $errors[] = $l['comments_notext']; 86 if(empty($com_form['sid'])) $errors[] = $this->l->_('comments_no_sid'); 87 if(isset($com_form['email']) AND $com_form['email'] != "" AND !preg_match("/^[^@]+@.+\.\D{2,6}$/", $com_form['email']) AND $com_form['email'] != $this->l->_('comments_email')) $errors[] = $this->l->_('comments_false_mail'); 88 if(empty($com_form['content'])) $errors[] = $this->l->_('comments_notext'); 84 89 if(isset($errors)) return $errors; 85 90 } 86 91 87 92 function com_clean_data($data) { 88 global $l; 89 if(empty($data['name']) OR $data['name'] == $l['comments_name']) $data['name'] = ""; 90 if(empty($data['city']) OR $data['city'] == $l['comments_city']) $data['city'] = ""; 91 if(empty($data['email']) OR $data['email'] == $l['comments_email']) $data['email'] = ""; 92 if(empty($data['homepage']) OR $data['homepage'] == $l['comments_homepage']) $data['homepage'] = ""; 93 if(empty($data['name']) OR $data['name'] == $this->l->_('comments_name')) $data['name'] = ""; 94 if(empty($data['city']) OR $data['city'] == $this->l->_('comments_city')) $data['city'] = ""; 95 if(empty($data['email']) OR $data['email'] == $this->l->_('comments_email')) $data['email'] = ""; 96 if(empty($data['homepage']) OR $data['homepage'] == $this->l->_('comments_homepage')) $data['homepage'] = ""; 93 97 94 98 if(empty($data['date'])) $data['date'] = time(); … … 126 130 $comment = " 127 131 <li id='c".$data['id']."'> 128 <p class='meta'><a class='permalink' title='".$ l['comments_permalink']."' href='#c".$data['id']."'>".$nr."</a> <cite>";132 <p class='meta'><a class='permalink' title='".$this->l->_('comments_permalink')."' href='#c".$data['id']."'>".$nr."</a> <cite>"; 129 133 if(!empty($meta['homepage'])) $comment .= "<a title='".$meta['homepage']."' href='".$meta['homepage']."'>"; 130 134 if(!empty($meta['name'])) $comment .= $meta['name']; 131 else $comment .= $ l['comments_anonym'];135 else $comment .= $this->l->_('comments_anonym'); 132 136 if(!empty($meta['homepage'])) $comment .= "</a>"; 133 137 $comment .= "</cite>"; 134 if(!empty($meta['city'])) $comment .= " ".$ l['comments_from']." ".$meta['city'];135 $comment .= " ".$ l['comments_posted']." ".strftime(JLOG_DATE_COMMENT, $data['date']).":</p>\n".$bbcomments->parse($data['content'])."</li>";138 if(!empty($meta['city'])) $comment .= " ".$this->l->_('comments_from')." ".$meta['city']; 139 $comment .= " ".$this->l->_('comments_posted')." ".strftime(JLOG_DATE_COMMENT, $data['date']).":</p>\n".$bbcomments->parse($data['content'])."</li>"; 136 140 137 141 ### Plugin Hook … … 140 144 return $comment; 141 145 } 146 147 function registerGlobal() 148 { 149 global $JLOG; 150 $JLOG['comments'] = &$this; 151 } 142 152 } 143 153 -
branches/1.5/lib/Jlog/Db.php
r1753 r1754 7 7 { 8 8 global $JLOG; 9 $l = &$JLOG['language']; 9 10 10 11 // connect to database 11 12 $connect = @mysql_connect(JLOG_DB_URL, JLOG_DB_USER, JLOG_DB_PWD); 12 13 if ($connect == FALSE) { 13 mail(JLOG_EMAIL, $l ['admin']['e_db'], $l['admin']['e_db_is']."\n".mysql_error());14 die("<strong>".$l ['db_error']."</strong><br />".$l['plz_try_again'].".");14 mail(JLOG_EMAIL, $l->_('admin.e_db'), $l->_('admin.e_db_is')."\n".mysql_error()); 15 die("<strong>".$l->_('db_error')."</strong><br />".$l->_('plz_try_again')."."); 15 16 } 16 17 // select our database 17 18 $select = @mysql_select_db(JLOG_DB); 18 19 if ($connect == FALSE) { 19 mail(JLOG_EMAIL, $l ['admin']['e_db'], $l['admin']['e_db_is']."\n".mysql_error());20 die("<strong>".$l ['db_error']."</strong><br />".$l['plz_try_again'].".");20 mail(JLOG_EMAIL, $l->_('admin.e_db'), $l->_('admin.e_db_is')."\n".mysql_error()); 21 die("<strong>".$l->_('db_error')."</strong><br />".$l->_('plz_try_again')."."); 21 22 } 22 23 // do some settings 23 24 @mysql_query("SET NAMES utf8"); 24 25 @mysql_query("SET sql_mode=''"); 26 } 25 27 28 function registerGlobal() 29 { 30 global $JLOG; 26 31 $JLOG['db'] = &$this; 27 32 } 28 33 29 30 34 // escape input for mysql 31 function escape _for_mysql($_data) {35 function escape($_data) { 32 36 if (is_array($_data)) foreach($_data as $key => $val) $_data[$key] = escape_for_mysql($val); 33 37 else $_data = mysql_escape_string($_data); … … 38 42 $sql = "DELETE FROM ".$table." WHERE id = '".$id."' LIMIT 1"; 39 43 40 require_once('Jlog/Db/Query.php'); 41 $trash = new Jlog_Db_Query($sql); 44 $trash = $this->query($sql); 42 45 if($trash->error()) { 43 46 echo "<pre>\n"; … … 48 51 return true; 49 52 } 53 54 function query($sql) 55 { 56 require_once('Jlog/Db/Query.php'); 57 return new Jlog_Db_Query($sql); 58 } 50 59 } 51 60 -
branches/1.5/lib/Jlog/Db/Query.php
r1753 r1754 1 1 <?php 2 2 3 // call database class 3 class Query { 4 class Jlog_Db_Query 5 { 4 6 // Variablen 5 var $_sql = "";6 var $_result = 0;7 var $_errno = 0;8 var $_error = "";7 var $_sql = ""; 8 var $_result = 0; 9 var $_errno = 0; 10 var $_error = ""; 9 11 10 //Konstruktor11 functionQuery($sql)12 {12 //Konstruktor 13 function Jlog_Db_Query($sql) 14 { 13 15 // Query in der Klasse speichern 14 $this->_sql = trim($sql);15 $this->_result = mysql_query($this->_sql);16 if(!$this->_result) {16 $this->_sql = trim($sql); 17 $this->_result = mysql_query($this->_sql); 18 if(!$this->_result) { 17 19 $this->_errno = mysql_errno(); 18 20 $this->_error = mysql_error(); 19 }20 }21 } 22 } 21 23 22 //Methoden 23 function error() 24 { 25 // Result-ID in einer tmp-Variablen speichern 26 $tmp = $this->_result; 27 // Variable in boolean umwandeln 28 $tmp = (bool)$tmp; 29 // Variable invertieren 30 $tmp = !$tmp; 31 // und zurÃŒckgeben 32 return $tmp; 33 } 24 //Methoden 25 function error() 26 { 27 return ($this->_result === false); 28 } 34 29 35 function getError() {36 if($this->error()) {30 function getError() { 31 if($this->error()) { 37 32 $str = "request:\n".$this->_sql."\n"; 38 33 $str .= "response:\n".$this->_error."\n"; 39 34 $str .= "Errorcode: ".$this->_errno; 40 } 41 else $str = "No error."; 42 return $str; 43 } 44 function getErrno() { 45 return $this->_errno; 46 } 35 } 36 else $str = "No error."; 37 return $str; 38 } 39 40 function getErrno() { 41 return $this->_errno; 42 } 47 43 48 function fetch() {49 if($this->error()) {44 function fetch() { 45 if($this->error()) { 50 46 echo "An Error has occurred, please check your MySQL-Query."; 51 47 $return = null; 52 } 53 else $return = mysql_fetch_assoc($this->_result); 54 return $return; 48 } 49 else $return = mysql_fetch_assoc($this->_result); 50 return $return; 51 } 52 53 function numRows() { 54 if($this->error()) { 55 $return = -1; 55 56 } 57 else $return = mysql_num_rows($this->_result); 58 return $return; 59 } 60 61 function free() { 62 // Speicher freimachen 63 mysql_free_result($this->_result); 64 } 65 } 56 66 57 function numRows() { 58 if($this->error()) { 59 $return = -1; 60 } 61 else $return = mysql_num_rows($this->_result); 62 return $return; 63 } 64 65 function free() { 66 // Speicher freimachen 67 mysql_free_result($this->_result); 68 } 69 70 } 71 ?> 67 // eof -
branches/1.5/lib/Jlog/Feeds.php
r1753 r1754 14 14 function update() 15 15 { 16 global $JLOG; 17 $l = &$JLOG['language']; 18 16 19 $now_date = getdate(); 17 20 $data = array('rss' => '', 'rss_full' => '', 'sub' => ''); … … 43 46 <link>".htmlspecialchars(JLOG_PATH)."</link> 44 47 <description>".htmlspecialchars(JLOG_DESCRIPTION)."</description> 45 <language>".$l ['language']."</language>48 <language>".$l->_('language')."</language> 46 49 <lastBuildDate>".date('r')."</lastBuildDate> 47 50 <docs>http://blogs.law.harvard.edu/tech/rss</docs> … … 63 66 if(isset($cc[$row['id']]) AND $cc[$row['id']] != 0) { 64 67 $tmp_comments = " <a class='comments' title='" 65 . $l ['content_comments_title']."' href='"68 . $l->_('content_comments_title')."' href='" 66 69 . blog($row['date'], $row['url'])."#comments'>(" 67 70 . $cc[$row['id']].")</a>"; … … 129 132 if (is_writable($filename)) { 130 133 if (!$handle = fopen($filename, 'w')) { 131 $errors[] .= $l ['admin']['can_not_open']." ($filename)";134 $errors[] .= $l->_('admin.can_not_open')." ($filename)"; 132 135 } 133 136 if (!fwrite($handle, $data[$d])) { 134 $errors[] .= $l ['admin']['can_not_write']." ($filename)";137 $errors[] .= $l->_('admin.can_not_write')." ($filename)"; 135 138 } 136 139 fclose($handle); 137 140
