Welcome to Geeklog, Anonymous Monday, November 25 2024 @ 05:40 am EST

Geeklog Forums

"quote of the day" coming soon to a blog near you

Page navigation


Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
Quote by ppmnt:don't mean to be a pain
you're not a pain.. these are things that I need to know.
oh, and I threw up the zip file per your advice.
 Quote

Status: offline

ppmnt

Forum User
Chatty
Registered: 06/09/04
Posts: 53
So I got 0.9.1.1 installed, and of course the first thing I tried was deleting a quote, since I noticed in manage.php that you already changed it.

Sun Oct 3 11:20:23 2004 - 1064: You have an error in your SQL syntax near 'gl_dailyquote_quotes WHERE gl_dailyquote_quotes.ID=35 LIMIT 1' at line 1. SQL in question: DELETE gl_dailyquote_quotes WHERE gl_dailyquote_quotes.ID=35 LIMIT 1

Seems you're missing the FROM (i.e. DELETE FROM table_name WHERE etc). I added it in manage.php in line 350 and 357 and it works fine.
 Quote

Status: offline

ppmnt

Forum User
Chatty
Registered: 06/09/04
Posts: 53
Quote by machinari: oh, and I threw up the zip file per your advice.

Very cool. Thanks.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
Quote by ppmnt:Seems you're missing the FROM

how very thorough of me, eh? sorry.
 Quote

Status: offline

ppmnt

Forum User
Chatty
Registered: 06/09/04
Posts: 53
Alright... Just tried approving a quote in the queue, which of course failed. I figure I won't tell you anymore when something doesn't work for me because of the MySQL version, you know better than me where you are doing multi-table updates or deletes. However, let me know if you need help looking at some of the SQL.

I do have one suggestion though: How about including the "Add Quote" link in the block and/or centerblock, if the user has enough rights to add quotes? Something like I did with my center block, which is now back up: _my_site_. If you don't think everyone would like that it could also be an optional setting.

Obviously it was easy for me to include it... Since I am allowing anonymous users to submit quotes I just added it to centerblock.thtml without any logic of checking for necessary rights (I know, I know, not good practice). It would be a little more work for you, I just thought I'd suggest it.
 Quote

Status: offline

ppmnt

Forum User
Chatty
Registered: 06/09/04
Posts: 53
Quote by machinari:
Quote by ppmnt:Seems you're missing the FROM

how very thorough of me, eh? sorry.


Every developer needs a good QA team! You can't find everything.
 Quote

Status: offline

shetzel

Forum User
Chatty
Registered: 03/19/04
Posts: 39
Zips are fine. I can do zips, as I think most Windows and Linux users can. What are most packages in, anyway? I don't even know for cross-platform stuff like this.

And thanks for getting the functions.inc file included for us. I'll be at it in a bit, after a break. Exciting stuff.

As for features to think about (worth about ):
1) The category stuff. I imagine something that would work like the topic system for the news posts. By default, all users can see any quote. However, some categories could be "turned off", either by the admin or by individual users in their Preferences screen. I am not implying that people would also be able to switch off quotes based on the author or the submitter (too much detail).

1b) As an example, when I migrate my existing quote list, I'll have mostly movie quotes, TV quotes, and a vast list of "personal" quotes, since my site is used primarily by people I know in person. When someone says something particularly funny or stupid, someone else usually submits that as a quote. Perhaps those quotes are all some users will want to see. Other users, who DON'T know us personally, might wish to skip those.

1c) It could be useful for the admin to do global category enable/disable, too. For example, I have a category of quotes that arose from specific events, say yearly St. Patrick's parties, where those quotes may seem ... out of place in September. I'd enable them only in March, for instance. I realize this is getting a bit theatrical, but I try to dress up the site before holidays like Google does. I change the title, put up bunting, etc, etc. I used to swap the quote datafile. Limiting the site to Chirstmas or patriotic (July 4th) categories for a couple weeks would not be beyond my uses. Feel free to ignore it, though.

2) I'd like the ability to turn on/off a "Submit" link like ppmnt suggested. Many people will certainly find it useful; however, I usually just build links like that into my title menu bar. It's where I've trained my users to look for that sort of thing.

3) I'd like the ability to display the submitter (as an option), so long as it's not the admin or anonymous. I find people are more willing to submit things to the database when they think that they will get public credit for them. I'll probably hack it into mine, sooner or later, if you don't.

3b) I still need to examine your display code. Once I do, I'll know more about what I'm asking you for. It may be simple or messy.

4) Option to turn off the title bar ("Quote of the Day") in the case of a center block placement, above the featured story. That's where I'm putting it on my site, where it really doesn't need any explaination. I can probably do it myself with a couple of deleted/modified lines, but it might be something others want.

That's all I got for now, believe me, I'll have more. Obviously, you'll be more concerned with base functionality right now. Just tell me to stop if you wish to fry those other fish before talking about these guppies. However, don't underestimate the demand your plugin will have in the community. I think you'll be pleasantly surprised to find out how many people will enjoy it. And from myself, thanks again.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
Quote by ppmnt:How about including the "Add Quote" link in the block and/or centerblock, if the user has enough rights to add quotes?
there is already a link in the user functions for logged in members to add a quote if they have rights. the only place where there is not a link on the main page is, as you say, if you are an anonymous user. sooooo.... ok, I just added it to my list. It will be an option, but only when anon add is turned on and will appear in centerblock and php_block.
Quote by shetzel:I'd like the ability to display the submitter (as an option)
the submitter is already displayed per quote in dailyquote/index.php. I realize you are suggesting to display it in the centerblock, however, I tend to go with the uncluttered look, which is why I didn't include links there either (at first anyway). How bout this: I'll add the code, but I'll leave the variable commented out in the template file. If you want the contributor's name all you have to do is uncomment said variable. I'm going to hold off on making it an option just for now.
Quote by shetzel:By default, all users can see any quote. However, some categories could be "turned off", either by the admin or by individual users in their Preferences screen.
This is an excellent idea for some of the reasons you stated. however, I'm going to put it on the back burner for now until the rest is operating smoothly. As you may have noticed, I only work on this on the weekends so it may be a couple.
Quote by shetzel: Option to turn off the title bar ("Quote of the Day") in the case of a center block placement, above the featured story
This is a function of GeekLog's plugin API in its handling of the centerblock. I cant help you there.
 Quote

Status: offline

shetzel

Forum User
Chatty
Registered: 03/19/04
Posts: 39
by: machinari] I'm going to put it on the back burner for now until the rest is operating smoothly. As you may have noticed, I only work on this on the weekends so it may be a couple.

I agree. The categories thing is something I want/need, but certainly not as important as getting the fundamentals done and smooth. So long as users are careful about adding quotes correctly, that funcionality can be "switched on" anytime. The data will be ready.

by: machinari] I realize you are suggesting to display it in the centerblock, however, I tend to go with the uncluttered look, which is why I didn't include links there either (at first anyway).

I tend to favor an uncluttered interface as well, so I appreciate your position on the contributor's name. But thanks for your compromise.

by: machinari] This is a function of GeekLog's plugin API in its handling of the centerblock. I cant help you there.

Yeah, I just found out that Geeklog requires the block header. I'll see if I can do anything for myself. It'll be a hack to get what I want, so nothing you'll be able to use.

'Preciate your time.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
find version 0.9.2 here.

This is the latest beta release. This should now be mySQL 3.23 compatable--this was the main issue for this release and needs testing especially on the moderation page (approve, delete, and update functions). This was actually easier than I thought it would be--I was making things more complicated than they needed to be.

A number of other things were tweaked as well. For example, there is now an option to display an add link in the centerblock for anon users when they have permission to add. Limiting/sorting by category also works properly now. The database tables have undergone a few more changes. Again, I have not provided an update script so if you have added many quotes that are not in the sample files provided, back them up because you'll have to run the install script again. In otherwords, if you don't know what you're doing, wait for version 1.0. Remember, this is still beta--released for testing purposes.

next version: category titles when limiting/searching by category; ability to turn on/off categories(admin only--for now); cleaner code; a few other tweaks; documentation.

Check it out and report any errors/bugs please. Also if you think of features you would like to see in this plugin, let me know, but remember, it is only a quote of the day type plugin so don't go crazy.

I should mention one bug/oddity that I haven't been able to track down or reproduce--that may be a good thing, maybe a bad thing. I searched for a single letter without limitation in my 700 quotes. returned a result set of just about all of them, but my CPU raced out of control. I thought it was mySQL in a loop, but shut it down and shut the web server down and still the cpu was going full throtle. finally had to shut the system down. Dunno what it was so just wanted you to be aware and maybe you could shed some light. maybe it's just my system needed a break.
 Quote

Status: offline

shetzel

Forum User
Chatty
Registered: 03/19/04
Posts: 39
Cool. I also thank you for dropping the (nearly) useless submitter table in this release. That tidies things up a bit, too.

A couple of small issues to report:

1) I uninstalled and tried to reinstall the plugin and got an SQL error. I had accidentally left the block installed and enabled during the procedure. It seems that phpblock_random_quote doesn't check to make sure that the plugin is installed completely before attempting an SQL query. Once disabled, I was able to install the block smoothly. Oddly enough, when the plugin wasn't installed at all, the block reported the missing function correctly and allowed the rest of the page to display. Not that important, but makes things look "professional" when upgrades are smooth. It was my fault, but others will make the same mistake.

2) I have some quotes that have apostrophes in the quoted field, i.e. "Luke's Father". In the site stats page, these quotes come up as "most quoted" and list counts correctly. When clicking on them, however, the search refuses to find any. The apostrophes (and a few other special chars) may need to be replaced in the hyperlinks like spaces are with "%20". Perhaps? Management search engine works fine, though.

3) Are you dropping planned support for the "What's New" block permanently? Just curious. I saw the indications in the config.php file and thoguht it might be in. But now I see that they're gone. Hardly important, but just wondering what your thinking is on this. Back-burner?

4) I've been poking around in your code and I like what I see. It's not as bad as you made it out to be. My modifications mostly involve displaying the "Submitted by" line to encourage submissions. The code was already in place for the centerblock, just like you said. I added similarly trivial code for the side block.

5) Just to let you know, my users were overjoyed to have their random quotes back after a 7-month hiatus. It is really appreciated.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
Quote by shetzel:phpblock_random_quote doesn't check to make sure that the plugin is installed completely before attempting an SQL query
good call, I can accomodate that very easily.
Quote by shetzel:In the site stats page, these quotes come up as "most quoted" and list counts correctly. When clicking on them, however, the search refuses to find any. The apostrophes (and a few other special chars) may need to be replaced in the hyperlinks like spaces are with "%20". Perhaps?
hmmm... my bad--i think. I thought I had gone through all that, but it's quite possible that I missed those few functions in the functions.inc file. I'll check into what I did with the slashes/spaces, etc. there. good testin!
Quote by shetzel:Are you dropping planned support for the "What's New" block
Well, I was planning on setting that up, and i'm still not unwilling to implement it, however... I get tired of looking at a rarely updated site that uses that block--all you see is "no new stories," "no new comments," "no new links," etc. so was just unsure of going ahead with that. again, just personal preference. I guess I could look into whether it would work as a configurable option or not.
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
Quote by machinari:
Quote by shetzel:phpblock_random_quote doesn't check to make sure that the plugin is installed completely before attempting an SQL query
good call, I can accomodate that very easily


[disclaimer: have not looked at the code]
If the plugin includes the phpblock function in the plugins functions.inc then you wont' have to check. The code for the function will not be included if the plugin is disabled or not installed. Also during the plugin installation, you can include the sql to insert the block definition. Include the delete of this record as well in the plugin un-install function.
Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

shetzel

Forum User
Chatty
Registered: 03/19/04
Posts: 39
by Blaine] If the plugin includes the phpblock function in the plugins functions.inc then you wont' have to check. The code for the function will not be included if the plugin is disabled or not installed.
It did it, I swear! After I thought to disable the side block, it all went through like Ex-Lax.
by machinari] I'll check into what I did with the slashes/spaces, etc. there. good testin!
Thanks, but it just happened to be the first one I clicked on when I discovered the page. Random chance, really. At first, I thought they were all busted/unfinished. By another random chance, I happend to click on a different one a couple days later.
by machinari] Again, just personal preference. I guess I could look into whether it would work as a configurable option or not.
Fair 'nuff. I'd probably use it, because it ties back to that whole "encourage the users" thing. They like the recognition, and having to go into a pool of 480 (currently) and waiting before 1 person notices your efforts may ... deter some people. Maybe deter is too strong a word, but I like giving them incentives.

Your call, totally. Or perhaps I'll look into it sometime if you don't get around to it first. My coding skilz aren't that bad...
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
Quote by shetzel:The apostrophes (and a few other special chars) may need to be replaced in the hyperlinks

try this until the next release: at approx. line 188 in search.php, change
Text Formatted Code
            list($quoted) = DB_fetchArray($result);
            $sql .= " AND Quoted='$quoted'";

 
to this
Text Formatted Code
            list($quoted) = DB_fetchArray($result);
            $quoted = slashctrl($quoted);
            $sql .= " AND Quoted='$quoted'";

 

and at approx. line 197, change
Text Formatted Code
    elseif (isset($stat)){// this comes from the GL stats page
        $sql .= " AND Quoted='$stat'";

 
to this
Text Formatted Code
    elseif (isset($stat)){// this comes from the GL stats page
        $stat = slashctrl($stat);
        $sql .= " AND Quoted='$stat'";

 
that works for me-- let me know if it works for you.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
Quote by Blaine:If the plugin includes the phpblock function in the plugins functions.inc then you wont' have to check
that function is in the functions.inc file per your advice earlier on. so nothing to change there.
Quote by Blaine:during the plugin installation, you can include the sql to insert the block definition. Include the delete of this record as well in the plugin un-install function.
more excellent ideas! adding this to my list as we speak, er, type...
 Quote

Status: offline

ppmnt

Forum User
Chatty
Registered: 06/09/04
Posts: 53
cheerful
machinari -- nice work! I just installed it and did just a couple of initial tests. I was able to update, delete, change categories... Yay. I still need to try other functionality that was MySQL version dependent (like moderation), but it looks cool so far!

I also like the option of including the "add quote" link in the centerblock. Thanks for adding that! One suggestion though: I think that if somebody wants to enable the add quote link, they'd probably want it to show for anybody who has the right to add quotes. I.e. if members and anonymous members can add quotes, then both of them should see the link. Otherwise you're only suggesting to anonymous users that they should share their quotes. What do you think?

Good stuff, good stuff.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
Quote by ppmnt:One suggestion though: I think that if somebody wants to enable the add quote link, they'd probably want it to show for anybody who has the right to add quotes. I.e. if members and anonymous members can add quotes, then both of them should see the link. Otherwise you're only suggesting to anonymous users that they should share their quotes. What do you think?
actually, my thinking was that there only be one "add" link on the page at any one time. let's say that anon and logged in users have permission to add. anon would see the link in the centerblock and logged in users would see it in their user's functions block. otherwise the link would appear in both places for the logged in member, which is more clutter than I prefer.

still up for discussion tho.

question: how do you find the cached quote time options (1 hour; 6 hours; etc.)? to limiting? need more options? other options? suggestions? or is it just fine?
 Quote

Status: offline

ppmnt

Forum User
Chatty
Registered: 06/09/04
Posts: 53
Quote by machinari:actually, my thinking was that there only be one "add" link on the page at any one time. let's say that anon and logged in users have permission to add. anon would see the link in the centerblock and logged in users would see it in their user's functions block. otherwise the link would appear in both places for the logged in member, which is more clutter than I prefer.

still up for discussion tho.


Oh, I see where you're coming from. Personally, I'd like it to be consistent. People who come to the page but their cookie is expired might see the link and then wonder why it disappeared when they logged in. I don't think having the link twice is that bad, it's similar to "get published" or other functionality like that, which usually shows up in the horizontal menu bar and again in a menu block on the left. Just my 2 cents (American, Canadian, or now European cents?).

Quote by machinariQuestion how do you find the cached quote time options (1 hour; 6 hours; etc.)? to limiting? need more options? other options? suggestions? or is it just fine?


I think it's fine the way it is. You could allow the admin to enter the number of hours, rounding to the closest half hour (e.g. .5 could be allowed). That is, if you're up for doing the appriate checking (i.e. has to be a number). I guess it would then become a radio button: either
o page refresh or
o [ ] hours

For me personally it's fine the way it is, because I treat it as a random quote, not a quote of the day. But it probably wouldn't be too hard to offer that additional admin function...
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
like this thread isn't long enough. update to 0.9.2. Find dialyquote 0.9.2.1 here.

+++ added support for the what's new block. this can be enabled or disabled in the dailyquote admin page (configured in the config.php). To accomodate this you can run the update script rather than the install script. just overwrite your files to make all other changes.
+++ revised the perms for the add link in the centerblock.
+++ slash control from the GL stats and search page should work now.
+++ the phpblock_random_quote() definition has been added to the plugin's install and uninstall routines.
+++ this thread is included in the docs dir for reference.

anymore necessary fixes notwithstanding, and once the documentation has been completed, and some sort of category management page is worked out (working on it), the official 1.0 version of the dailyquote plugin will be available for download on this site.
 Quote

Page navigation

All times are EST. The time is now 05:40 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content