Changeset 1941
- Timestamp:
- 2006-02-02 16:33:24 (3 years ago)
- Files:
-
- Anode/trunk/acidfree/class_annodex.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Anode/trunk/acidfree/class_annodex.inc
r1940 r1941 207 207 $result = db_query("SELECT * FROM {acidfree_cmml_clips} WHERE nid={$node->nid} ORDER BY `start`;"); 208 208 209 /* Output clip information in a themed table. */ 210 $table_rows = array(); 211 $header = array(); 212 209 213 while( $row = db_fetch_object($result) ) { 214 215 $cells = array(); 216 217 $cells[] = array('data'=>l($row->id, "node/{$node->nid}",NULL,"$arg_name=annodex&id={$row->id}")."<br />"); 210 218 if( $row->img ) { 211 $output .= "<a href =\"?q=node/{$node->nid}&$arg_name=annodex&id={$row->id}\"><img height=120 width=120 src=\"{$row->img}\"></a>"; 219 $cells[] = array('data'=>"<a href =\"?q=node/{$node->nid}&$arg_name=annodex&id={$row->id}\"><img height=120 width=120 src=\"{$row->img}\"></a>"); 220 } else { 221 $cells[] = array('data'=>NULL); 212 222 } 213 $output .= l($row->id, "node/{$node->nid}",NULL,"$arg_name=annodex&id={$row->id}")."<br />"; 214 } 223 224 if( $row->desc ) { 225 $cells[] = array('data'=>$row->desc); 226 } else { 227 $cells[] = array('data'=>NULL); 228 } 229 230 /* Add cells */ 231 $table_rows[] = $cells; 232 } 233 /* Add table */ 234 $output .= theme_table( $header, $table_rows ); 215 235 216 236 /* Add new clip form */ … … 248 268 249 269 if( $occurances == 0 ) { 250 $result = db_query("INSERT INTO {acidfree_cmml_clips} (`nid`, `a_href`, `a_text`, `img`, `desc`, `start`, `end`, `id`, `track`) VALUES('{$node->nid}', '{$attributes['a_href']}', '{$attributes['a_text']}', '{$attributes['img']}', '{$attributes['desc']}', $start, {$attributes['end']},'{$attributes['id']}', '{$attributes['track']}');");270 $result = db_query("INSERT INTO {acidfree_cmml_clips} (`nid`, `a_href`, `a_text`, `img`, `desc`, `start`, `end`, `id`, `track`) VALUES('{$node->nid}', '{$attributes['a_href']}', '{$attributes['a_text']}', '{$attributes['img']}', '{$attributes['desc']}', $start, ".(float)$attributes['end'].",'{$attributes['id']}', '{$attributes['track']}');"); 251 271 } else { 252 272 $result = db_query("UPDATE {acidfree_cmml_clips} SET `nid` = '{$node->nid}', `a_href` = '{$attributes['a_href']}', `a_text` = '{$attributes['a_text']}', `img` = '{$attributes['img']}', `desc` = '{$attributes['desc']}', `start` = '$start', `end` = '{$attributes['end']}', `id` = '{$attributes['id']}', `track` = '{$attributes['track']}' WHERE `id` = '{$attributes['id']}';");