vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   QuoteIt! Quote Management System v1.2 (https://vborg.vbsupport.ru/showthread.php?t=62470)

magnus 03-13-2004 10:00 PM

QuoteIt! Quote Management System v1.2
 
[hr]-[/hr]

QuoteIt! Development has been continued in this thread. Please use this link for the latest version!

[hr]-[/hr]

QuoteIt! 1.2

Description
This hack will allow you to maintain a database of quotes which can be added by users and displayed on FORUMHOME. Admin function includes the ability to delete quotes from the database.

Yes, you can use multi-line quotes. ;)

Information
Requested by djohn (re: https://vborg.vbsupport.ru/showthread.php?t=62420)

Thanks to Giveit2u43 for the username code!

Tested on RC4, should work on RC1+

Version History
v1.0 - Initial Release
v1.1 - Added ability to list all quotes as well as direct quote linking
v1.2 - Added quote moderation abilities

Planned Features
v2.0
- Quote rating system
- Top {X} Quotes

If you use this, please click https://vborg.vbsupport.ru/

[hr]-[/hr]
UPGRADES

v1.1 -> v1.2 UPGRADE INSTRUCTIONS

v1.0 -> v1.1 UPGRADE INSTRUCTIONS

[hr]-[/hr]
3RD PARTY MODIFICATIONS/ADD-ONS

[high]1. Add QuoteIt! to your vbIndex homepage! by [name]Giveit2u43[/name][/high]
[high]2. Add Who's Online Locations for QuoteIt! by [name]Acido[/name][/high]

magnus 03-13-2004 10:15 PM

*sigh* I completely forgot to include the "quotes.php" file in the first zip. The first post has been updated.

I swear, sometimes I'd forget my head...

croft 03-13-2004 10:27 PM

this is pretty cool =)
Im gonna use this when you get more features in it. Great work.

MindTrix 03-13-2004 10:28 PM

Nice work, cheers for releasing :)

Osterling 03-13-2004 10:34 PM

i will use this once v2 comes out :D

AutomatikStudio 03-14-2004 02:08 AM

Quote:

Originally Posted by exasko
i will use this once v2 comes out :D

You my friend missed the boat LONG ago. ;)

SteveK 03-14-2004 04:22 AM

It looks like you missed a few " . TABLE_PREFIX . " in both index.php and quotes.php

I'll post the changes later if needed.

gmarik 03-14-2004 05:26 AM

Now this looks good - you made it quicker that KuraFire, thanks!

magnus 03-14-2004 07:03 AM

Quote:

Originally Posted by SteveK
It looks like you missed a few " . TABLE_PREFIX . " in both index.php and quotes.php

I'll post the changes later if needed.

So I did.. I've updated the .ZIP file. Good call. ;)

deathemperor 03-14-2004 10:39 AM

nice hack, I'm going to install this after the vb3 gold ^ ^

daFish 03-14-2004 10:50 AM

Nice hack. Installed it on my testsystem and its running fine.
Looking forward to verison 2. :)

Giveit2u43 03-14-2004 12:27 PM

My members are loving this hack and having great fun adding quotes.. One feature they did request was that It showed up the name of the member who submitted the quote.. I`ll be adding this myself on my installation but thought it might be a nice addition for the official version, maybe with an admin on/off option??

magnus 03-14-2004 12:44 PM

Quote:

Originally Posted by Giveit2u43
My members are loving this hack and having great fun adding quotes.. One feature they did request was that It showed up the name of the member who submitted the quote.. I`ll be adding this myself on my installation but thought it might be a nice addition for the official version, maybe with an admin on/off option??

Yea, that'll be added. I store the userid of the person who submitted the quote, so it's just a matter of tossing $randomquote[userid] out somewhere.

Giveit2u43 03-14-2004 12:47 PM

Quote:

Originally Posted by magnus
Yea, that'll be added. I store the userid of the person who submitted the quote, so it's just a matter of tossing $randomquote[userid] out somewhere.

Yeah just noticed that as I was looking at the code.. I changed your query to:

Code:

$result_quote = $DB_site->query("
                        SELECT quotes.*,user.username AS quotename FROM ".TABLE_PREFIX."quotes AS quotes
                        LEFT JOIN ".TABLE_PREFIX."user AS user ON (user.userid = quotes.userid)
                        ORDER BY rand() LIMIT 1
                ");
       
                while ($quote = $DB_site->fetch_Array($result_quote)) {
                        $randomquote[quoteid] = $quote[quoteid];
                        $randomquote[quote] = $quote[quote];
                        $randomquote[author] = $quote[author];
                        $randomquote[username] = $quote[quotename];
                }
                $DB_site->free_result($result_quote);
       
                eval('$showrandomquote .= "' . fetch_template('randomquote') . '";');

and then you can place $randomquote[username] where you want the submitters username to show :)

magnus 03-14-2004 04:57 PM

v1.0 -> v1.1 UPGRADE INSTRUCTIONS

1. Download the quoteit1.1.zip from the first post, and upload the new quotes.php to your forum ROOT directory.

2. Run the following SQL query (or, you can insert the following phrase manually into the GLOBAL category):
[SQL]
INSERT INTO phrase (languageid, varname, text, phrasetypeid) VALUES (0, 'view_all_quotes', 'View All', 1);
[/SQL]

3. Edit the randomquote TEMPLATE:

Find:
HTML Code:

<if condition="$bbuserinfo['userid']">(<a href=$vboptions[bburl]/quotes.php?do=addquote>$vbphrase[add_a_quote]</a><if condition="$bbuserinfo['permissions']['adminpermissions']"> | <a href="$vboptions[bburl]/quotes.php?do=delquote&quoteid=$randomquote[quoteid]">$vbphrase[delete_this_quote]</a></if>)</if>
REPLACE with:
HTML Code:

<if condition="$bbuserinfo['userid']">(<a href=$vboptions[bburl]/quotes.php?do=addquote>$vbphrase[add_a_quote]</a><if condition="$bbuserinfo['permissions']['adminpermissions']"> | <a href="$vboptions[bburl]/quotes.php?do=delquote&quoteid=$randomquote[quoteid]">$vbphrase[delete_this_quote]</a></if> | <a href="$vboptions[bburl]/quotes.php?do=list">$vbphrase[view_all_quotes]</a>)</if>
4. Create the following NEW templates:

TEMPLATE: quote_listquote
HTML Code:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head><title>$vboptions[bbtitle] - $vbphrase[random_quote]</title>
$headinclude
</head>
<body>
$header
$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="$stylevar[tablewidth]" align="center">
<thead>
        <tr>
                <td class="tcat" colspan="2">
                        <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_randomquote')"><img id="collapseimg_forumhome_randomquote" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_randomquote].gif" alt="" border="0" /></a>
                        $vbphrase[random_quote]
                </td>
        </tr>
</thead>
<tbody id="collapseobj_forumhome_randomquote" style="$vbcollapse[collapseobj_forumhome_randomquote]">
$quotelistbit
</tbody>
</table><br />
$pagenav

$footer
</body>
</html>

TEMPLATE: quotelistbit
HTML Code:

<table class="tborder" cellpadding="3" cellspacing="0" border="0" width="$stylevar[tablewidth]" align="center">
        <tr>
                <td class="alt1 smallfont" align="left">
                Added by: <a href="$vboptions[bburl]/member.php?userid=$randomquote[userid]">$randomquote[username]
                </td>
                <td class="alt1" align="right">
                <a href="$vboptions[bburl]/quotes.php?do=view&quoteid=$randomquote[quoteid]">#$randomquote[quoteid]</a>
                </td>
        </tr>
        <tr>
                <td class="alt1" align="center" colspan="2">
                <i>"$randomquote[quote]"</i>
                </td>
        </tr>
        <tr>
                <td class="alt1 smallfont" align="left">
                <if condition="$bbuserinfo['permissions']['adminpermissions']">(<a href="$vboptions[bburl]/quotes.php?do=delquote&quoteid=$randomquote[quoteid]">$vbphrase[delete_this_quote]</a>)</if>
                </td>
                <td class="alt1" align="right">
                - <b>$randomquote[author]</b>
                </td>
        </tr>
</table>

Done !!

NuclioN 03-14-2004 06:25 PM

"this is a test" ( | | )test quote <-- is what i see. No username and no link to submit or display all quotes :(

Leah 03-14-2004 06:45 PM

Quote:

Originally Posted by NuclioN
"this is a test" ( | | )test quote <-- is what i see. No username and no link to submit or display all quotes :(

I had the same problem, but when I clicked edit on one of the phrases and saved it without doing anything in the admincp it fixed it somehow.

Leah 03-14-2004 06:46 PM

Does anyone know why I get this error message on the indexpage?

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /usr/home/sites/xxxxxx/www/forum/index.php(115) : eval()'d code on line 19

Parse error: parse error, expecting `']'' in /usr/home/sites/xxxxxxx/www/forum/index.php(115) : eval()'d code on line 19

magnus 03-14-2004 07:26 PM

Quote:

Originally Posted by NuclioN
"this is a test" ( | | )test quote <-- is what i see. No username and no link to submit or display all quotes :(

Yea, like kie said. Open up the phrase manager, click "edit" on any thread (it doesn't matter which), and then click save. In some cases you need to reload(?) the phrase database. I have no idea why, but I've run into this myself before.

magnus 03-14-2004 07:30 PM

Quote:

Originally Posted by kie
Does anyone know why I get this error message on the indexpage?

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /usr/home/sites/xxxxxx/www/forum/index.php(115) : eval()'d code on line 19

Parse error: parse error, expecting `']'' in /usr/home/sites/xxxxxxx/www/forum/index.php(115) : eval()'d code on line 19

Looks like a cut & paste gone wrong? I'm assuming line 19 is the QuoteIt! code. It looks like you left off a few trailing characters, open up the readme file and cut/paste again.

NuclioN 03-14-2004 07:34 PM

Ok, that worked. :) there are two quotes now but when i click on 'View All' no quote is visable.

magnus 03-14-2004 07:40 PM

Quote:

Originally Posted by NuclioN
Ok, that worked. :) there are two quotes now but when i click on 'View All' no quote is visable.

You've got the link screwed up.

It should be
Code:

$vboptions[bburl]/quotes.php?do=list
You have:
Code:

$vboptions[bburl]/quotes.php?do=view
I checked the .ZIP file, to see if it was a mistake on my part.. but it appears you modified the templates, and mistakenly confused the link. ;)

NuclioN 03-14-2004 07:42 PM

Ok tnx. :)

--edit-- works ok now

Leah 03-14-2004 07:49 PM

Quote:

Originally Posted by magnus
Looks like a cut & paste gone wrong? I'm assuming line 19 is the QuoteIt! code. It looks like you left off a few trailing characters, open up the readme file and cut/paste again.

That didn't work.

magnus 03-14-2004 07:51 PM

Quote:

Originally Posted by kie
That didn't work.

Ok, remove the QuoteIt! code from index.php all together. Then, see if you still get the error.

Leah 03-14-2004 07:55 PM

Quote:

Originally Posted by magnus
Ok, remove the QuoteIt! code from index.php all together. Then, see if you still get the error.

I didn't get the error when I removed the code.

I also don't get the error when I have the code, but turn off the random quotes from the admincp.

magnus 03-14-2004 07:59 PM

Just for the hell of it..

In INDEX.PHP:

Find:
PHP Code:

// ### WELCOME MESSAGE ################################################# 

Add ABOVE:
PHP Code:

    // ### QUOTEIT #########################################################
if ($vboptions['showquote'])
{
    
$result_quote $DB_site->query("
        SELECT * FROM " 
TABLE_PREFIX "quotes ORDER BY rand() LIMIT 1
    "
);

    while (
$quote $DB_site->fetch_Array($result_quote)) {
        
$randomquote[quoteid] = $quote[quoteid];
        
$randomquote[quote] = $quote[quote];
        
$randomquote[author] = $quote[author];
        
$randomquote[userid] = $quote[userid];
        
$randomquote[approved] = $quote[approved];
    }
    
$DB_site->free_result($result_quote);

    eval(
'$showrandomquote .= "' fetch_template('randomquote') . '";');



Leah 03-14-2004 08:04 PM

Didn't fix it.
The problem appeared after I tried to upgrade, so I'm guessing that it's something with the new templates og something.

magnus 03-14-2004 08:07 PM

Quote:

Originally Posted by kie
Didn't fix it.
The problem appeared after I tried to upgrade, so I'm guessing that it's something with the new templates og something.

Ahh! I know what it is. I've gone ahead an edited the upgrade instructions. I had cut and paste them from the installer, and I forgot that I left them escaped. So, just edit the template and look for any instance of \' and replace it with just '.

You'll need to edit the randomquote, quote_listquote and quotelistbit templates.

That's why it's crapping out. ;)

Giveit2u43 03-14-2004 08:09 PM

Magnus, you need to strip the \'s out of the html above.. they`re okay when you're using an installer but cause problems when you're manually adding the templates..

also you`ve changed the name of the function for view to list, but not changed the link in the html in the upgrade instructions.

magnus 03-14-2004 08:10 PM

Quote:

Originally Posted by Giveit2u43
Magnus, you need to strip the \'s out of the html above.. they`re okay when you're using an installer but cause problems when you're manually adding the templates..

also you`ve changed the name of the function for view to list, but not changed the link in the html in the upgrade instructions.

Yep. Beat ya to it. ;)

Giveit2u43 03-14-2004 08:12 PM

Quote:

Originally Posted by magnus
Yep. Beat ya to it. ;)

*L* Just noticed that now.. thought I was being quick with my fixes.. apparently not :) but I do have one you haven`t spotted *g*

You missed two templates from the global templates array.. it should be:

Code:

$globaltemplates = array(
        'quote_addquote',
        'quote_delquote',
        'quote_listquote',
        'quotelistbit'
);


magnus 03-14-2004 08:16 PM

Damn you! j/k :D

Ok, I updated the .ZIP file.. good looking out, thanks. ;)

Leah 03-14-2004 08:52 PM

Quote:

Originally Posted by magnus
Ahh! I know what it is. I've gone ahead an edited the upgrade instructions. I had cut and paste them from the installer, and I forgot that I left them escaped. So, just edit the template and look for any instance of \' and replace it with just '.

You'll need to edit the randomquote, quote_listquote and quotelistbit templates.

That's why it's crapping out. ;)

That fixed it!
Thank you. It's a great hack. :)

Rushty 03-15-2004 01:57 PM

Any chance in a future version of adding an option in the user control panel to allow users to turn off the quotes for themselves.

Also maybe an approval system so admins have to approve the quote before its viewabale.

daFish 03-15-2004 02:03 PM

A nice addition for a future version would be categories for quotes and the ability to show them only one day of the week or so. :)

magnus 03-15-2004 04:56 PM

Quote:

Originally Posted by Rushty
Any chance in a future version of adding an option in the user control panel to allow users to turn off the quotes for themselves.

Also maybe an approval system so admins have to approve the quote before its viewabale.

Actually, I just completed the approval section. Whether I wait until v2.0, or I release v1.2. I'll have to see. ;)

As for the user toggle, sure, I could add that. Consider it done. ;)

magnus 03-15-2004 04:57 PM

Quote:

Originally Posted by daFish
A nice addition for a future version would be categories for quotes and the ability to show them only one day of the week or so. :)

Hrm.. I'll consider categories, we'll see.

As for when to display, do you mean it displays 1 quote per day/week/month rather than randomly changing every refresh?

gmarik 03-15-2004 06:42 PM

Categorys would be awesome!

DrkFusion 03-16-2004 12:25 AM

Thanks for this hack! Works great on a friends board, I modified it to take quotes from this website which provides RSS feeds of quotes. I developed an importer which takes the feeds and puts them into a database for this hack, I might release it as an addon. Doesn't seem stable as there is no interface for it pure backend.

This hack seems to be working fine, and is an asset since I had this incorporated on the main portal page.

Regards & Nice job!


All times are GMT. The time now is 06:35 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01597 seconds
  • Memory Usage 1,871KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (4)bbcode_html_printable
  • (2)bbcode_php_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete