Changeset 6776
- Timestamp:
- 10/06/08 20:56:41 (3 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
interface/owner/data/export/index.php (modified) (2 diffs)
-
interface/owner/data/import/index.php (modified) (1 diff)
-
library/components/Textcube.Data.Notice.php (modified) (4 diffs)
-
library/piece/owner/header.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/interface/owner/data/export/index.php
r6474 r6776 151 151 } 152 152 $writer->write('</post>'); 153 $writer->write(CRLF); 153 154 } while ($post->shift()); 154 155 $post->close(); … … 157 158 if ($notice->open()) { 158 159 do { 159 $writer->write('<notice' . $newlineStyle . '>' .160 $writer->write('<notice' . ' slogan="' . htmlspecialchars($notice->slogan) . '"' . $newlineStyle . '>' . 160 161 '<id>' . $notice->id . '</id>' . 161 162 '<visibility>' . $notice->visibility . '</visibility>' . -
trunk/interface/owner/data/import/index.php
r6474 r6776 425 425 $notice = new Notice(); 426 426 $notice->id = $node['id'][0]['.value']; 427 $notice->slogan = @$node['.attributes']['slogan']; 427 428 $notice->visibility = $node['visibility'][0]['.value']; 428 429 if(isset($node['starred'][0]['.value'])) -
trunk/library/components/Textcube.Data.Notice.php
r6473 r6776 15 15 $this->starred = 16 16 $this->title = 17 $this->slogan = 17 18 $this->content = 18 19 $this->contentFormatter = … … 103 104 $query->setAttribute('userid',getUserId()); 104 105 } 106 $this->saveSlogan(); 105 107 if (!$query->insert()) 106 108 return $this->_error('insert'); … … 128 130 if (!isset($this->modified)) 129 131 $query->setAttribute('modified', 'UNIX_TIMESTAMP()'); 130 132 if (isset($this->slogan)) 133 $this->saveSlogan(); 134 131 135 if (!$query->update()) 132 136 return $this->_error('update'); … … 151 155 if ($attachment->open('parent = ' . $this->id)) 152 156 return $attachment; 157 } 158 159 function saveSlogan($slogan = null) { 160 global $database; 161 $this->init(); 162 if (!Validator::number($this->id, 1)) 163 return $this->_error('id'); 164 if (!Validator::number($this->userid, 1)) 165 return $this->_error('userid'); 166 if (isset($slogan)) 167 $this->slogan = $slogan; 168 169 $query = new TableQuery($database['prefix'] . 'Entries'); 170 $query->setQualifier('blogid',$this->blogid); 171 if(isset($this->userid)) $query->setQualifier('userid', $this->userid); 172 $query->setQualifier('id', $this->id); 173 if (!$query->doesExist()) 174 return $this->_error('id'); 175 176 if (isset($this->slogan) && $this->validateSlogan($this->slogan)) 177 $slogan0 = $this->slogan; 178 else 179 $slogan0 = $this->slogan = $this->makeSlogan($this->title); 180 181 $slogan0 = UTF8::lessenAsEncoding($slogan0, 255); 182 183 for ($i = 1; $i < 1000; $i++) { 184 $checkSlogan = POD::escapeString($this->slogan); 185 $query->setAttribute('slogan', $checkSlogan, false); 186 if (!POD::queryExistence( 187 "SELECT id FROM {$database['prefix']}Entries " 188 . "WHERE blogid = ".$this->blogid." AND id <> {$this->id} AND slogan ='{$checkSlogan}'") 189 ) 190 { 191 if (!$query->update()) 192 return $this->_error('update'); 193 return true; 194 } 195 $this->slogan = UTF8::lessenAsEncoding($slogan0, 245) . '-' . $i; 196 } 197 // if try saveSlogan again, slogan string has more $i 198 return $this->_error('limit'); 153 199 } 154 200 -
trunk/library/piece/owner/header.php
r6750 r6776 356 356 <?php 357 357 }*/ 358 if( ($service['interface'] == 'simple') || ($service['effect'])) {358 if($service['interface'] == 'simple') { 359 359 if(!in_array($blogMenu['contentMenu'],array('post','edit'))) { 360 360 ?>
