Author |
Message |
08/08/2005 12:02:18
|
riza
Newbie
Joined: 08/08/2005 11:52:37
Messages: 4
Offline
|
The following adds a good search capability to the gbook
However the problems are 2 :
the result will display the main post only and will miss the comments added onto the guestposts
pagination - if there are say 1000 results it needs to be paginated
If pagination is not possible is it possible to limit the number of results to a prespecified value ?
Any help will be greatly appreciated.
|
|
08/08/2005 15:42:02
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
I am curious as to why people would want to search a guestbook :-/
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
08/08/2005 18:41:35
|
riza
Newbie
Joined: 08/08/2005 11:52:37
Messages: 4
Offline
|
1)Many guestbooks have already search function included like xeoman[ xeoman.com/ ]
2)Guestbooks can be searched for certain terms or phrases like "we want more of this and this" by the visitors - this can help to gauge the needs/demands of visitors particularly when one has say thousand or more entries
3)Guestbook is not just guestbook - at certain sites it is like a comment or suggestion book like a science site where one may like to look up certain terms that has been used more than others
4) Some more reasons .....
By the way, do you have any working solution - I will be really grateful
|
|
08/08/2005 18:46:51
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
Not off the top of my head no. I get funny about people downloading a guestbook then using it as something else and complaining that it doesn't do something that a script dedicated to what they want would have. Thats a generic rant btw. The other one I got asked for recently was adding statistics to the guestbook
As a quickies I'd say it would be simple enough. It's just a case of changing the query done for a normal guestbok display to the search query then it would be formated and paginated.
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
08/08/2005 18:47:33
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
Oh and as to limitting yes just use LIMIT
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
08/08/2005 18:53:16
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
Having looked yes it would be simple(ish) to do. Bit more complicated if you want to do more than search for a single string (ie if you want to use operators in the search). It would be just a case of checking if they aer performing a search in index.php and then creating the query for the search and passing it on to the entry retrieval (echo $gb->show_entries($entry, $SEARCHQUERY) and then adding the new variable to the functions that get called and switching the query in get_entries
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
08/08/2005 18:53:45
|
riza
Newbie
Joined: 08/08/2005 11:52:37
Messages: 4
Offline
|
I get funny about people downloading a guestbook then using it as something else and complaining that it doesn't do something
Hello Carbonize, I am not complaining at all
this script is as wonderful as it can be, and I was just wondering if things further could be done !
However we always grow and uses come into play, like I said, many gbs have this function already implemented.
Even, html does a lot more than what it was intended to be
Adding just LIMIT is not helping and as I said the result page will show the main post or comment and not the comment-on-comments as they belong to different tables
Any REAL help will be greatly appreciated.
|
|
08/08/2005 21:56:15
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
My last post make sense to you?
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
09/08/2005 00:14:19
|
riza
Newbie
Joined: 08/08/2005 11:52:37
Messages: 4
Offline
|
Hello Carbonize,
Thanks The last post makes sense.
However ,perhaps I have been unable to explain what I was looking for in my very first post.
then creating the query for the search
the actual problem is at this step. I am no mysql expert and so I was asking for actual codes - the way i create the search query covers only the comments and not the subcomments ( that is comments on comment ). Thus I am dealing with the table book_data , but I also need to deal with table book_com in the same go. How ??
The other part was to paginate the results.
Any further help from anyone will be sincerely appreciated.
|
|
09/08/2005 00:20:42
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
Only realistic way of searching both entries and comments would require you to make your own output format as you couldn't really use the current guestbooks formatting. As to searching both tables possibly a JOIN may do it. Then again maybe not. I'll think about it.
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
|