boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

b2Books

 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
Joseph



Joined: 28 Oct 2002
Posts: 27
Location: Waterloo, Canada

PostPosted: Tue Jun 10, 2003 12:24 am    Post subject: b2Books Reply with quote

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 Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Mystis



Joined: 02 Mar 2003
Posts: 74

PostPosted: Tue Jun 10, 2003 1:22 am    Post subject: Reply with quote

Very nice job Smile 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
View user's profile Send private message
Joseph



Joined: 28 Oct 2002
Posts: 27
Location: Waterloo, Canada

PostPosted: Tue Jun 10, 2003 1:49 am    Post subject: Reply with quote

hey - good point.

although you'd have to tweak the text
_________________
http://www.lewismedia.com
http://www.redpointlife.com/joseph
http://www.bent-comic.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
lcf



Joined: 05 May 2003
Posts: 92
Location: Malaysia

PostPosted: Tue Jun 10, 2003 1:55 am    Post subject: Reply with quote

I think... the b2Links hack can do the same, too. and it is more flexible.
_________________
LcF
http://weblog.lcfwebsite.com
Back to top
View user's profile Send private message Visit poster's website
XYboi



Joined: 17 Feb 2003
Posts: 18
Location: Miami, FL.

PostPosted: Wed Jun 25, 2003 4:06 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Joseph



Joined: 28 Oct 2002
Posts: 27
Location: Waterloo, Canada

PostPosted: Wed Jun 25, 2003 4:12 am    Post subject: Reply with quote

First, There's no simple way to let people add comments - sorry. I'll mull on it though.

Second - just delete that line. The line is from another mod I made, and doesn't need to be included Smile
_________________
http://www.lewismedia.com
http://www.redpointlife.com/joseph
http://www.bent-comic.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
XYboi



Joined: 17 Feb 2003
Posts: 18
Location: Miami, FL.

PostPosted: Wed Jun 25, 2003 4:31 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Joseph



Joined: 28 Oct 2002
Posts: 27
Location: Waterloo, Canada

PostPosted: Wed Jun 25, 2003 4:45 am    Post subject: Reply with quote

It should be pretty easy - I'll post the modification you need to make later tomorrow - I'm going to bed now Smile
_________________
http://www.lewismedia.com
http://www.redpointlife.com/joseph
http://www.bent-comic.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Panthra



Joined: 05 Jul 2003
Posts: 9

PostPosted: Mon Jul 21, 2003 6:13 am    Post subject: Reply with quote

::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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group