| verzia 1.9, 2004/01/16 19:46:33 |
verzia 1.10, 2005/03/13 10:23:18 |
|
|
| * http://platon.sk/projects/phpMyEdit/ |
* http://platon.sk/projects/phpMyEdit/ |
| */ |
*/ |
| |
|
| /* $Platon: phpMyEdit/extensions/phpMyEdit-messages.class.php,v 1.8 2003/11/20 11:52:30 nepto Exp $ */ |
/* $Platon: phpMyEdit/extensions/phpMyEdit-messages.class.php,v 1.9 2004/01/16 19:46:33 nepto Exp $ */ |
| |
|
| /* This extension is part of phpMyEzin: Content Management System project, |
/* This extension is part of phpMyEzin: Content Management System project, |
| where it handles discussion messages for particular articles. It depends on |
where it handles discussion messages for particular articles. It depends on |
| Riadok 41 class phpMyEdit_messages extends phpMyEd |
|
| Riadok 41 class phpMyEdit_messages extends phpMyEd |
|
| /* Preserved article ID in CGI environment. */ |
/* Preserved article ID in CGI environment. */ |
| /* TODO: change to $this->article_id or something like this */ |
/* TODO: change to $this->article_id or something like this */ |
| global $ezin_admin_article; |
global $ezin_admin_article; |
| $ezin_admin_article = $this->get_cgi_var('article_id'); |
$ezin_admin_article = $this->get_data_cgi_var('article_id'); |
| |
|
| $execute && $this->execute(); |
$execute && $this->execute(); |
| } /* }}} */ |
} /* }}} */ |
| Riadok 50 class phpMyEdit_messages extends phpMyEd |
|
| Riadok 50 class phpMyEdit_messages extends phpMyEd |
|
| { |
{ |
| global $HTTP_SERVER_VARS; |
global $HTTP_SERVER_VARS; |
| $PHP_SELF = $HTTP_POST_VARS['PHP_SELF']; |
$PHP_SELF = $HTTP_POST_VARS['PHP_SELF']; |
| $ezin_admin_article_change_up = $this->get_cgi_var('ezin_admin_article_change_up'); |
$ezin_admin_article_change_up = $this->get_sys_cgi_var('ezin_admin_article_change_up'); |
| $ezin_admin_article_change_down = $this->get_cgi_var('ezin_admin_article_change_down'); |
$ezin_admin_article_change_down = $this->get_sys_cgi_var('ezin_admin_article_change_down'); |
| if (isset($ezin_admin_article_change_up)) { |
if (isset($ezin_admin_article_change_up)) { |
| $ezin_admin_article = $this->get_cgi_var('ezin_admin_article_up'); |
$ezin_admin_article = $this->get_sys_cgi_var('ezin_admin_article_up'); |
| } elseif (isset($ezin_admin_article_change_down)) { |
} elseif (isset($ezin_admin_article_change_down)) { |
| $ezin_admin_article = $this->get_cgi_var('ezin_admin_article_down'); |
$ezin_admin_article = $this->get_sys_cgi_var('ezin_admin_article_down'); |
| } |
} |
| !isset($ezin_admin_article) && $ezin_admin_article = $this->get_cgi_var('article_id'); |
!isset($ezin_admin_article) && $ezin_admin_article = $this->get_data_cgi_var('article_id'); |
| $ezin_admin_article = intval($ezin_admin_article); |
$ezin_admin_article = intval($ezin_admin_article); |
| $query = sprintf('SELECT article_id, count(id) AS messages FROM %s' |
$query = sprintf('SELECT article_id, count(id) AS messages FROM %s' |
| .' GROUP BY article_id HAVING article_id = %d', |
.' GROUP BY article_id HAVING article_id = %d', |
| Riadok 66 class phpMyEdit_messages extends phpMyEd |
|
| Riadok 66 class phpMyEdit_messages extends phpMyEd |
|
| return false; |
return false; |
| } |
} |
| $row = @mysql_fetch_array($result, MYSQL_ASSOC); |
$row = @mysql_fetch_array($result, MYSQL_ASSOC); |
| $ezin_admin_article = intval($row['article_id']); |
//$ezin_admin_article = intval($row['article_id']); |
| $ezin_admin_msgcount = intval($row['messages']); |
$ezin_admin_msgcount = intval($row['messages']); |
| @mysql_free_result($result); |
@mysql_free_result($result); |
| |
echo "[$ezin_admin_article]"; |
| |
|
| echo '<form class="',$this->getCSSclass('form'); |
echo '<form class="',$this->getCSSclass('form'); |
| echo '" action="',$page_name,'" method="POST">',"\n"; |
echo '" action="',$page_name,'" method="POST">',"\n"; |
| Riadok 136 class phpMyEdit_messages extends phpMyEd |
|
| Riadok 137 class phpMyEdit_messages extends phpMyEd |
|
| echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n"; |
echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n"; |
| $this->message_nav_buttons($ezin_admin_article, $ezin_admin_msgcount, 'down'); |
$this->message_nav_buttons($ezin_admin_article, $ezin_admin_msgcount, 'down'); |
| } |
} |
| echo '<input type="hidden" name="article_id" value="',$ezin_admin_article,'">',"\n"; |
echo $this->htmlHiddenData('article_id', $ezin_admin_article); |
| echo '</form>',"\n"; |
echo '</form>',"\n"; |
| } /* }}} */ |
} /* }}} */ |
| |
|
| Riadok 172 class phpMyEdit_messages extends phpMyEd |
|
| Riadok 173 class phpMyEdit_messages extends phpMyEd |
|
| echo htmlspecialchars($ar[$i]['subject']); |
echo htmlspecialchars($ar[$i]['subject']); |
| echo '</td>',"\n"; |
echo '</td>',"\n"; |
| echo '<td class="',$css_class_name2,'">'; |
echo '<td class="',$css_class_name2,'">'; |
| echo '<input',$checked,' class="',$css_class_name2,'" type="radio" name="rec"'; |
echo '<input',$checked,' class="',$css_class_name2,'"'; |
| |
echo ' type="radio"',$this->cgi['prefix']['sys'].'name="rec"'; |
| echo ' value="',$ar[$i]['id'],'" class="link"></td>',"\n"; |
echo ' value="',$ar[$i]['id'],'" class="link"></td>',"\n"; |
| echo '<td class="',$css_class_name,'">',htmlspecialchars($ar[$i]['author']), '</td>'; |
echo '<td class="',$css_class_name,'">',htmlspecialchars($ar[$i]['author']), '</td>'; |
| echo '<td class="',$css_class_name,'">',htmlspecialchars($ar[$i]['datetime']),'</td>'; |
echo '<td class="',$css_class_name,'">',htmlspecialchars($ar[$i]['datetime']),'</td>'; |
| Riadok 217 class phpMyEdit_messages extends phpMyEd |
|
| Riadok 219 class phpMyEdit_messages extends phpMyEd |
|
| echo '<td class="',$this->getCSSclass('buttons2', $position),'">',"\n"; |
echo '<td class="',$this->getCSSclass('buttons2', $position),'">',"\n"; |
| if ($article_id > 0) { |
if ($article_id > 0) { |
| if ($this->add_enabled()) { |
if ($this->add_enabled()) { |
| echo '<input class="',$this->getCSSclass('prev', $position); |
echo $this->htmlSubmit('operation', 'Add', $this->getCSSclass('add', $position), false, false), ' '; |
| echo '" type="submit" name="operation" value="',$this->labels['Add'],'"> '; |
|
| } |
} |
| if ($messages_count > 0) { |
if ($messages_count > 0) { |
| if ($this->view_enabled()) { |
if ($this->view_enabled()) { |
| echo '<input class="',$this->getCSSclass('view', $position),'"'; |
echo $this->htmlSubmit('operation', 'View', $this->getCSSclass('view', $position), false, !$total_recs), ' '; |
| echo ' type="submit" name="operation" value="',$this->labels['View'],'"> '; |
|
| } |
} |
| if ($this->change_enabled()) { |
if ($this->change_enabled()) { |
| echo '<input class="',$this->getCSSclass('change', $position),'"'; |
echo $this->htmlSubmit('operation', 'Change', $this->getCSSclass('change', $position), false, !$total_recs), ' '; |
| echo ' type="submit" name="operation" value="',$this->labels['Change'],'"> '; |
|
| } |
} |
| if ($this->delete_enabled()) { |
if ($this->delete_enabled()) { |
| echo '<input class="',$this->getCSSclass('delete', $position),'"'; |
echo $this->htmlSubmit('operation', 'Delete', $this->getCSSclass('delete', $position), false, !$total_recs), ' '; |
| echo ' type="submit" name="operation" value="',$this->labels['Delete'],'"> '; |
|
| } |
} |
| } |
} |
| } |
} |
| Riadok 250 class phpMyEdit_messages extends phpMyEd |
|
| Riadok 248 class phpMyEdit_messages extends phpMyEd |
|
| } |
} |
| echo '<td class="',$this->getCSSclass('buttons2', $position),'">',"\n"; |
echo '<td class="',$this->getCSSclass('buttons2', $position),'">',"\n"; |
| if ($this->change_operation()) { |
if ($this->change_operation()) { |
| echo '<input class="',$this->getCSSclass('save', $position); |
echo $this->htmlSubmit('savechange', 'Save', $this->getCSSclass('save', $position), true), ' '; |
| echo '" type="submit" name="savechange" value="',$this->labels['Save'],'"> '; |
echo $this->htmlSubmit('morechange', 'Apply', $this->getCSSclass('more', $position), true), ' '; |
| echo '<input class="',$this->getCSSclass('more', $position); |
echo $this->htmlSubmit('cancelchange', 'Cancel', $this->getCSSclass('cancel', $position), false); |
| echo '" type="submit" name="morechange" value="',$this->labels['Apply'],'"> '; |
|
| echo '<input class="',$this->getCSSclass('cancel', $position); |
|
| echo '" type="button" name="cancel" value="',$this->labels['Cancel']; |
|
| echo '" onClick="form.submit();">',"\n"; |
|
| } elseif ($this->add_operation()) { |
} elseif ($this->add_operation()) { |
| echo '<input class="',$this->getCSSclass('save', $position); |
echo $this->htmlSubmit('saveadd', 'Save', $this->getCSSclass('save', $position), true), ' '; |
| echo '" type="submit" name="saveadd" value="',$this->labels['Save'],'"> '; |
echo $this->htmlSubmit('moreadd', 'More', $this->getCSSclass('more', $position), true), ' '; |
| echo '<input class="',$this->getCSSclass('more', $position); |
echo $this->htmlSubmit('canceladd', 'Cancel', $this->getCSSclass('cancel', $position), false); |
| echo '" type="submit" name="moreadd" value="',$this->labels['More'],'"> '; |
|
| echo '<input class="',$this->getCSSclass('cancel', $position); |
|
| echo '" type="button" name="cancel" value="',$this->labels['Cancel']; |
|
| echo '" onClick="form.submit();">',"\n"; |
|
| } elseif ($this->delete_operation()) { |
} elseif ($this->delete_operation()) { |
| echo '<input class="',$this->getCSSclass('save', $position); |
echo $this->htmlSubmit('savedelete', 'Delete', $this->getCSSclass('save', $position), false), ' '; |
| echo '" type="submit" name="savedelete" value="',$this->labels['Delete'],'"> '; |
echo $this->htmlSubmit('canceldelete', 'Cancel', $this->getCSSclass('cancel', $position), false); |
| echo '<input class="',$this->getCSSclass('cancel', $position); |
|
| echo '" type="button" name="cancel" value="',$this->labels['Cancel']; |
|
| echo '" onClick="form.submit();">',"\n"; |
|
| } elseif ($this->view_operation()) { |
} elseif ($this->view_operation()) { |
| if ($this->change_enabled()) { |
if ($this->change_enabled()) { |
| echo '<input class="',$this->getCSSclass('save', $position); |
echo $this->htmlSubmit('operation', 'Change', $this->getCSSclass('save', $position), false), ' '; |
| echo '" type="submit" name="operation" value="',$this->labels['Change'],'"> '; |
|
| } |
} |
| echo '<input class="',$this->getCSSclass('cancel', $position); |
echo $this->htmlSubmit('cancelview', 'Cancel', $this->getCSSclass('cancel', $position), false); |
| echo '" type="submit" name="cancel" value="',$this->labels['Cancel'],'">',"\n"; |
|
| } |
} |
| // Message is now written here |
// Message is now written here |
| echo '</td>',"\n"; |
echo '</td>',"\n"; |
| Riadok 287 class phpMyEdit_messages extends phpMyEd |
|
| Riadok 272 class phpMyEdit_messages extends phpMyEd |
|
| function print_article_select($selected_id, $disabled, $position) /* {{{ */ |
function print_article_select($selected_id, $disabled, $position) /* {{{ */ |
| { |
{ |
| if ($selected_id <= 0) { |
if ($selected_id <= 0) { |
| $rec = intval($this->get_cgi_var('rec')); |
$rec = intval($this->get_sys_cgi_var('rec')); |
| if ($rec > 0) { |
if ($rec > 0) { |
| $query = sprintf('SELECT article_id FROM %s WHERE id = %d', |
$query = sprintf('SELECT article_id FROM %s WHERE id = %d', |
| $this->tb, $rec); |
$this->tb, $rec); |
| Riadok 313 class phpMyEdit_messages extends phpMyEd |
|
| Riadok 298 class phpMyEdit_messages extends phpMyEd |
|
| } |
} |
| @mysql_free_result($result); |
@mysql_free_result($result); |
| } |
} |
| echo '<select',($disabled ? ' disabled' : ''); |
echo '<select',($disabled ? ' disabled' : ''),' name="'; |
| echo ' name="ezin_admin_article_',$position,'" size="1">',"\n"; |
echo $this->cgi['prefix']['sys'].'ezin_admin_article_',$position,'" size="1">',"\n"; |
| echo '<option value="0">-- Choose article --</option>',"\n"; |
echo '<option value="0">-- Choose article --</option>',"\n"; |
| foreach ($articles as $row) { |
foreach ($articles as $row) { |
| $row['title'] = empty($row['title']) ? $row['atitle'] : $row['title']; |
$row['title'] = empty($row['title']) ? $row['atitle'] : $row['title']; |
| Riadok 328 class phpMyEdit_messages extends phpMyEd |
|
| Riadok 313 class phpMyEdit_messages extends phpMyEd |
|
| } |
} |
| echo '</select>',"\n"; |
echo '</select>',"\n"; |
| if (! $disabled) { |
if (! $disabled) { |
| echo '<input type="submit" name="ezin_admin_article_change_',$position,'" value=" > "> ',"\n"; |
echo $this->htmlSubmit('ezin_admin_article_change_'.$position, ' > ', $this->get_sys_cgi_var('change', $position)), ' ', "\n"; |
| } |
} |
| return true; |
return true; |
| } /* }}} */ |
} /* }}} */ |