View previous topic :: View next topic |
Author |
Message |
Joseph
Joined: 28 Oct 2002 Posts: 27 Location: Waterloo, Canada
|
Posted: Tue Jun 10, 2003 12:24 am Post subject: b2Books |
|
|
I just slapped this together - I wanted an easy way to list the books I'm currently reading, and I couldn't find anything someone had already made.
It's pretty straight forward - it stored the author, title and description of the book, has a nice little admin center to it and if your host lets you run the query right, it'll add the table on it's own the first time you try to use the admin center.
if your host won't let you run the necessary query (i.e. you only get an error when trying to access the admin part) add the following table to your b2 install:
CREATE TABLE `b2books` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`book_title` VARCHAR( 255 ) NOT NULL ,
`author` VARCHAR( 100 ) NOT NULL ,
`description` TEXT NOT NULL ,
PRIMARY KEY ( `id` )
);
Anyway, with no further ado - http://www.redpointlife.com/joseph/b2books.zip
and you can see it in action on my blog - http://www.redpointlife.com/joseph
If anyone wants any special features added, let me know and I'll see what I can do. If you install this, I'd love to hear it. Reply here or drop me an email  |
|
Back to top |
|
 |
Mystis
Joined: 02 Mar 2003 Posts: 74
|
Posted: Tue Jun 10, 2003 1:22 am Post subject: |
|
|
Very nice job I should probably point out that it will work wonderfully with music and movies as well. _________________ - Mystis
[url=tidakada.com/board/viewtopic.php?t=3375]b2customfields v2[/url] | [url=tidakada.com/board/viewtopic.php?t=3375]b2sql[/url] | [url=tidakada.com/board/viewtopic.php?t=3375]b2quotes[/url] |
|
Back to top |
|
 |
Joseph
Joined: 28 Oct 2002 Posts: 27 Location: Waterloo, Canada
|
|
Back to top |
|
 |
lcf
Joined: 05 May 2003 Posts: 92 Location: Malaysia
|
Posted: Tue Jun 10, 2003 1:55 am Post subject: |
|
|
I think... the b2Links hack can do the same, too. and it is more flexible. _________________ LcF
http://weblog.lcfwebsite.com |
|
Back to top |
|
 |
XYboi
Joined: 17 Feb 2003 Posts: 18 Location: Miami, FL.
|
Posted: Wed Jun 25, 2003 4:06 am Post subject: |
|
|
I ran into this error:
Fatal error: Call to undefined function: convert_people() in /home/xyboi/public_html/blog/b2bookspopup.php on line 72
Code: | $row['description'] = convert_people($row['description']); |
That was line 72 in my b2bookspopup.php .
And just a question, is there anyway to possibly add a comments feature to this? You know, what if a viewer has a comment on the book, or maybe they've read it before. Just a minor thing, but the hack is really useful! _________________ --
* Support the Site. Support the Boi. Visit XYboi.S-S.Org * |
|
Back to top |
|
 |
Joseph
Joined: 28 Oct 2002 Posts: 27 Location: Waterloo, Canada
|
|
Back to top |
|
 |
XYboi
Joined: 17 Feb 2003 Posts: 18 Location: Miami, FL.
|
Posted: Wed Jun 25, 2003 4:31 am Post subject: |
|
|
yeah, it seems like adding a comment features would be tough.. but no big deal.
and indeed that did fix the code.
And something I just thought of, would the list just continue to lenthen as you add books? Is there anyway to show like a limit. Like, showing only the last three or whatever, I'm using it on my site, as a "recently read", and I actually have it in an iframe on my index page, since my whole code is not in php, nor in the b2 file, and I don't want this iframe to keep growing, and throwing off my whole site. Hehe. this would be cool, and I kno i'm being a pest. = D. sorry about that. _________________ --
* Support the Site. Support the Boi. Visit XYboi.S-S.Org * |
|
Back to top |
|
 |
Joseph
Joined: 28 Oct 2002 Posts: 27 Location: Waterloo, Canada
|
|
Back to top |
|
 |
Panthra
Joined: 05 Jul 2003 Posts: 9
|
Posted: Mon Jul 21, 2003 6:13 am Post subject: |
|
|
::dances around in circles:: I just hacked this to my own specifications, and I'm really new to PHP so don't mind my excitement at getting this to work!!
Instead of having the title/author link to a popup I wanted it to link to a post discussing the book. In order to do so I edited the b2books.php by replacing the original segment of code
Quote: | {
echo "<a href=\"$siteurl/b2bookspopup.php?id=$row[id]\" onclick=\"b2open(this.href); return false\" style=\"font-family: arial;\">$row[book_title] by $row[author]</a>";
}
|
with this:
Quote: |
{
echo "<a href=\"$siteurl?p=$row[description]\">$row[book_title] by $row[author]</a><br>";
}
|
In the admin area when adding a book you put the id of the post in the description so that you basically call up the individual post. I plan on putting in a generic "coming soon" post for the books I haven't discussed yet so that you don't get broken links.
Right now Amazonia and the Poisonwood Bible are properly linked on my site. _________________ http://www.gwytherinn.com |
|
Back to top |
|
 |
|