Пример #1
0
<table border="0" cellpadding="10">
<tr>
	<td>
	<table border="0" cellpadding="3" cellspacing="0">
	<?php 
if (isset($feedback)) {
    echo '<tr><td colspan="6" height="25">' . $feedback . '</td></tr>';
}
$default_ab = $ab->get_default_addressbook($GO_SECURITY->user_id);
echo '<tr height="30"><td colspan="6"><a href="addressbook.php?return_to=' . urlencode($link_back) . '" class="normal">' . $ab_new_ab . '</a></td></tr>';
echo '<tr><td><h3>' . $ab_default . '</h3></td><td><h3>' . $strName . '</h3></td><td><h3>' . $ab_owner . '</h3></td><td><h3>' . $ab_subscribed . '</h3></td><td>&nbsp;</td><td>&nbsp;</td></tr>';
$ab_count = $ab->get_user_addressbooks($GO_SECURITY->user_id);
$ab1 = new addressbook();
if ($ab_count > 0) {
    while ($ab->next_record()) {
        if ($ab1->is_subscribed($GO_SECURITY->user_id, $ab->f("id"))) {
            $checked = 'checked';
        } else {
            $checked = '';
        }
        $check = $ab->f('id') == $default_ab ? 'checked' : '';
        echo '<tr><td><input type="radio" name="default_addressbook_id" value="' . $ab->f("id") . '" ' . $check . ' /></td>';
        echo '<td nowrap><a href="index.php?post_action=browse&addressbook_id=' . $ab->f("id") . '" class="normal">' . htmlspecialchars($ab->f("name")) . '</a>&nbsp;</td>';
        echo '<td nowrap>' . show_profile($ab->f("user_id")) . '&nbsp;</td>';
        echo '<td align="center">&nbsp;<input type="checkbox" name="subscribed[]" value="' . $ab->f("id") . '" ' . $checked . ' /></td>';
        echo '<td>&nbsp;<a href="addressbook.php?addressbook_id=' . $ab->f("id") . '&return_to=' . urlencode($link_back) . '" title="' . $strEdit . ' \'' . htmlspecialchars($ab->f("name")) . '\'"><img src="' . $GO_THEME->images['edit'] . '" border="0" /></a></td>';
        if ($ab->f('user_id') == $GO_SECURITY->user_id) {
            echo "<td>&nbsp;<a href='javascript:delete_addressbook(\"" . $ab->f("id") . "\",\"" . div_confirm_id($strDeletePrefix . "'" . addslashes($ab->f("name")) . "'" . $strDeleteSuffix) . "\")' title=\"" . $strDeleteItem . " '" . htmlspecialchars($ab->f("name")) . "'\"><img src=\"" . $GO_THEME->images['delete'] . "\" border=\"0\"></a></td>";
        }
        echo "</tr>\n";
    }
Пример #2
0
                        $_POST['addressbook_id'] = $next_id;
                    }
                } else {
                    unset($addressbook_id);
                }
            }
            $post_action = 'addressbooks';
            break;
        case 'subscribe':
            $ab->unsubscribe_all($GO_SECURITY->user_id);
            if (isset($_POST['subscribed'])) {
                for ($i = 0; $i < sizeof($_POST['subscribed']); $i++) {
                    $ab->subscribe($GO_SECURITY->user_id, $_POST['subscribed'][$i]);
                }
            }
            if (!$ab->is_subscribed($GO_SECURITY->user_id, $_POST['default_addressbook_id'])) {
                $ab->subscribe($GO_SECURITY->user_id, $_POST['default_addressbook_id']);
            }
            $ab->set_default_addressbook($GO_SECURITY->user_id, $_POST['default_addressbook_id']);
            $post_action = 'addressbooks';
            break;
    }
}
$addressbook_id = isset($_REQUEST['addressbook_id']) ? $_REQUEST['addressbook_id'] : $ab->get_default_addressbook($GO_SECURITY->user_id);
$is_treeview = isset($_REQUEST['treeview']) ? $_REQUEST['treeview'] : '0';
if (!$addressbook_id) {
    $ab_name = $_SESSION['GO_SESSION']['name'];
    $new_ab_name = $ab_name;
    $x = 1;
    while ($ab->get_addressbook_by_name($new_ab_name)) {
        $new_ab_name = $ab_name . ' (' . $x . ')';