Upgrade to 5.X

TheCrow - May 27, 2007 - 10:31
Project:Bookmarks
Version:4.7.x-1.x-dev
Component:Code
Category:task
Priority:critical
Assigned:Unassigned
Status:patch (code needs review)
Description

I have seen only now that the code of upgrade from head version have been sent.
But i worked from 4.7 code for make a 5.x version and i publish my patch that can be useful.
I have tested this in local installation with Drupal 5.1.

the other files:

bookmarks.install:

<?php
function bookmarks_install() {
  switch (
$GLOBALS['db_type']) {
    case
'mysql':
    case
'mysqli':
     
$result = db_query("CREATE TABLE {bookmarks} (
                  uid int UNSIGNED NOT NULL,
                  url varchar(128) NOT NULL,
                  title varchar(128) NOT NULL
      )"
);
     
     
$result = db_query("ALTER TABLE bookmarks ADD INDEX (uid);");
      break;
    case
'pgsql'
       
$result = db_query("CREATE TABLE {bookmarks} (
                    uid SERIAL PRIMARY KEY,
                    url VARCHAR(255) NOT NULL,
                    title VARCHAR(255) NOT NULL
        )"
);
      break;
  } 
}

function
bookmarks_uninstall() {
 
$result = db_query("DROP TABLE {bookmarks}");
}

?>

bookmarks.info:

name = "Bookmarks"
description = "Bookmark your page"

version = "5.x-1.x-dev"

AttachmentSize
bookmarks_4.patch2.79 KB

#1

abramo - June 2, 2007 - 18:48

@TheCrow : : many thanks : : excellent : : this works perfectly for me.

#2

TheCrow - June 27, 2007 - 10:33

good :)

#3

alex_b - November 7, 2007 - 21:26
Priority:normal» critical

Many thanks for the patch. Tested. Works great.

What's the status quo of getting this actually in?

I improved the patch - now it adds .info and .install file automatically. DB definition files (.mysql and .pgsql) still need to be removed manually.

AttachmentSize
bookmarks_5.patch4.33 KB

#4

alex_b - November 8, 2007 - 01:11
Status:patch (to be ported)» patch (reviewed & tested by the community)

Fixed: the query part that passed in the title on the quick link was broken.

AttachmentSize
bookmarks_6.patch4.5 KB

#5

Roger López - February 29, 2008 - 20:04

<?php
$result
= db_query("ALTER TABLE bookmarks ADD INDEX (uid);");
?>

should be

<?php
result
= db_query("ALTER TABLE {bookmarks} ADD INDEX (uid);");
?>

with braces around the table name.

Otherwise works nicely. good work.

#6

Roger López - February 29, 2008 - 20:04
Status:patch (reviewed & tested by the community)» patch (code needs review)

#7

DesignWork - March 17, 2008 - 02:52

Hi all,

I was working on this bookmark modul today and I did some major changes on it.

It's kind of rewrite so I will apply no patch at the moment.

What's new:
Now you can under admin/settings/bookmarks chose the node types that will have an bookmark link. This bookmark link will give you the possibility to add any node to your bookmarks on the node display even without the bookmark block. If you have allready bookmarked this node the link changes to unbookmark and you can delete it from there.

Bookmarking an node will give you an new form with an textarea for descriptions. By default it will show you the node teaser if there is one. This form will store the node type in the database as well (for better identification).

At least I changed the "My Bookmarks" page. It shows now the title as link, the node type, the description, and the operations.

TO DO: I want to have a link to the author of the node in the "My Bookmark" page and i would like to group my bookmarks and make them available to others. If somebody want´s to help on this tasks would be great.

I need some tester, so spend some time with it please :) and give me some feed back.

But anyway here comes the new Code. Pay attention it makes changes to the bookmarks tabel so be carefull.

Warm regards from Cologne.

Dirk

AttachmentSize
bookmarks.install.txt1.04 KB
bookmarks.module.txt14.71 KB

#8

maulwuff - April 9, 2008 - 19:06

Hmm, the url seems to be not working for me. It is always empty. I tested with forum, page, story.
I use drupal 5.7

#9

TheCrow - April 11, 2008 - 10:30

@alex_b: Thank's you for the big patch, can you upgrade it with the correction of Roger Lopez?

@Roger Lopez: Thank's you for your correction, waiting for the alex_b Big Patch i republish the code of bookmark.install:

<?php
function bookmarks_install() {
  switch (
$GLOBALS['db_type']) {
    case
'mysql':
    case
'mysqli':
     
$result = db_query("CREATE TABLE {bookmarks} (
                  uid int UNSIGNED NOT NULL,
                  url varchar(128) NOT NULL,
                  title varchar(128) NOT NULL
      )"
);
    
     
$result = db_query("ALTER TABLE {bookmarks} ADD INDEX (uid);");
      break;
    case
'pgsql':
       
$result = db_query("CREATE TABLE {bookmarks} (
                    uid SERIAL PRIMARY KEY,
                    url VARCHAR(255) NOT NULL,
                    title VARCHAR(255) NOT NULL
        )"
);
      break;
  }
}

function
bookmarks_uninstall() {
 
$result = db_query("DROP TABLE {bookmarks}");
}
?>

The complete module is available at this address, is the version upgraded with Roger Lopez correction...

@maulwuff: I use it under Drupal 5.7 and for me seem work, explain better what is your problem/configuration thank's you.

 
 

Drupal is a registered trademark of Dries Buytaert.