コード例 #1
0
ファイル: bookmark.php プロジェクト: erico-deh/ocPortal
 function testEditBookmark()
 {
     // Test the forum edits
     edit_bookmark($this->bookmark_id, 4, "nnnnn", "www.xyz.com");
     // Test the forum was actually created
     $this->assertTrue('nnnnn' == $GLOBALS['SITE_DB']->query_value('bookmarks', 'b_title ', array('id' => $this->bookmark_id)));
 }
コード例 #2
0
ファイル: bookmarks.php プロジェクト: JustineBABY/mywords
    }
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $sql = "DELETE FROM " . $db->prefix("mod_mywords_bookmarks") . " WHERE id_book IN (" . implode(',', $books) . ")";
    if ($db->queryF($sql)) {
        redirectMsg('bookmarks.php', __('Database updated successfully!', 'mywords'), 0);
    } else {
        redirectMsg('bookmarks.php', __('Errors ocurred while trying to update database!', 'mywords') . '<br />' . $db->error(), 0);
    }
}
$action = rmc_server_var($_REQUEST, 'action', '');
switch ($action) {
    case 'new':
        save_bookmark();
        break;
    case 'edit':
        edit_bookmark();
        break;
    case 'save':
        saveBookmark();
        break;
    case 'saveedit':
        save_bookmark(true);
        break;
    case 'activate':
        activate_bookmark(1);
        break;
    case 'deactivate':
        activate_bookmark(0);
        break;
    case 'delete':
        delete_bookmark();
コード例 #3
0
ファイル: bookmarks.php プロジェクト: erico-deh/ocPortal
 /**
  * The actualiser to edit a bookmark.
  *
  * @return tempcode		The UI
  */
 function _edit_bookmark()
 {
     $title = get_page_title('EDIT_BOOKMARK');
     $id = get_param_integer('id');
     if (post_param('delete', NULL) !== NULL) {
         $member = get_member();
         delete_bookmark($id, $member);
     } else {
         $caption = post_param('caption');
         $page_link = post_param('page_link');
         $member = get_member();
         edit_bookmark($id, $member, $caption, $page_link);
     }
     $url = build_url(array('page' => '_SELF', 'type' => 'misc'), '_SELF');
     return redirect_screen($title, $url, do_lang_tempcode('SUCCESS'));
 }