Changeset 4652
- Timestamp:
- 11/05/07 20:58:18 (13 months ago)
- Location:
- trunk/lib
- Files:
-
- 2 modified
-
model/blog.entry.php (modified) (2 diffs)
-
plugins.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/model/blog.entry.php
r4625 r4652 695 695 AND draft = 0 LIMIT 1"); 696 696 if ($result == 0) { // if changed 697 $result = DBQuery::query Count("SELECT slogan FROM {$database['prefix']}Entries WHERE blogid = $blogid AND slogan = '$slogan' AND draft = 0 LIMIT 1");698 for ($i = 1; $result > 0; $i++) {697 $result = DBQuery::queryExistence("SELECT slogan FROM {$database['prefix']}Entries WHERE blogid = $blogid AND slogan = '$slogan' AND draft = 0 LIMIT 1"); 698 for ($i = 1; $result != false; $i++) { 699 699 if ($i > 1000) 700 700 return false; 701 701 $slogan = tc_escape_string(UTF8::lessenAsEncoding($slogan0, 245) . '-' . $i); 702 $result = DBQuery::query Count("SELECT slogan FROM {$database['prefix']}Entries WHERE blogid = $blogid AND slogan = '$slogan' AND draft = 0 LIMIT 1");702 $result = DBQuery::queryExistence("SELECT slogan FROM {$database['prefix']}Entries WHERE blogid = $blogid AND slogan = '$slogan' AND draft = 0 LIMIT 1"); 703 703 } 704 704 } … … 946 946 WHERE blogid = $blogid AND id = {$entry['id']} AND draft = 0"); 947 947 if ($entry['visibility'] == -3) { 948 if ($result && setEntryVisibility($entry['id'], 2)) 949 setEntryVisibility($entry['id'], 3); 948 if ($result && setEntryVisibility($entry['id'], 2)) { 949 $updatedEntry = getEntry($blogid, $entry['id']); 950 fireEvent('UpdatePost', $entry['id'], $updatedEntry); 951 setEntryVisibility($entry['id'], 3); 952 } 950 953 } 951 954 else { 952 if ($result) 955 if ($result) { 953 956 setEntryVisibility($entry['id'], abs($entry['visibility'])); 957 $updatedEntry = getEntry($blogid, $entry['id']); 958 fireEvent('UpdatePost', $entry['id'], $updatedEntry); 959 } 954 960 } 955 961 } -
trunk/lib/plugins.php
r4637 r4652 109 109 unset($tag); 110 110 } 111 if ( $xmls->doesExist('/plugin/binding/center')) {111 if (doesHaveMembership() && $xmls->doesExist('/plugin/binding/center')) { 112 112 $title = htmlspecialchars($xmls->getValue('/plugin/title[lang()]')); 113 113 foreach ($xmls->selectNodes('/plugin/binding/center') as $center) { … … 161 161 $configMappings[$plugin] = array( 'config' => 'ok') ; 162 162 } 163 if ( $xmls->doesExist('/plugin/binding/adminMenu')) {163 if (doesHaveMembership() && $xmls->doesExist('/plugin/binding/adminMenu')) { 164 164 $title = htmlspecialchars($xmls->getValue('/plugin/title[lang()]')); 165 165 … … 229 229 unset($params); 230 230 231 if ( $xmls->doesExist('/plugin/binding/adminMenu/methods')) {231 if (doesHaveMembership() &&$xmls->doesExist('/plugin/binding/adminMenu/methods')) { 232 232 foreach($xmls->selectNodes('/plugin/binding/adminMenu/methods/method') as $adminMethods) { 233 233 $method = array(); … … 286 286 unset($usedFor); 287 287 } 288 if ( $xmls->doesExist('/plugin/binding/editor[lang()]')) {288 if (doesHaveMembership() && $xmls->doesExist('/plugin/binding/editor[lang()]')) { 289 289 $editorCount = $editorCount + 1; 290 290 foreach (array($xmls->selectNode('/plugin/binding/editor[lang()]')) as $editor) { … … 313 313 314 314 if ($disablePlugin == true) { 315 $query = "DELETE FROM `{$database['prefix']}Plugins` 316 WHERE `blogid` = ".getBlogId()." 317 AND name = '".tc_escape_string($plugin)."'"; 318 DBQuery::query($query); 315 deactivatePlugin($plugin); 319 316 } 320 317 }
