vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   QuoteIt! - Quote Database (https://vborg.vbsupport.ru/showthread.php?t=97585)

Cap'n Steve 11-19-2005 01:29 AM

Here's the entire template. You're apparently missing the opening <style> tag on the first line which would cause problems. Taking out the closing </table> tag would also cause problems, but it still has nothing to do with the navbar. Did the two navbars appear before or after you changed the template? I can't duplicate either of your problems so it must have something to do with your style or the other modules.

HTML Code:

<style type="text/css">
.vote {
        color:$stylevar[smallfont_fgcolor];
        font-family:'trebuchet ms',helvetica,sans-serif;
        font-size:110%;
        font-weight:bold;
        background-color:$stylevar[button_bgcolor];
<if condition="$vboptions[ratequote]==1">
        width:25px;
        height:25px;
</if>
        border-top-color:$stylevar[alt2_bgcolor];
        border-left-color:$stylevar[alt2_bgcolor];
        border-right-color:$stylevar[alt1_bgcolor];
        border-bottom-color:$stylevar[alt1_bgcolor];
        filter:progid:DXImageTransform.Microsoft.Gradient
        (GradientType=0,StartColorStr='#aa$gradient1',EndColorStr='#aa$gradient2');}
}
</style>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="$stylevar[tablewidth]" align="center">
<thead>
        <tr>
                <td class="tcat">
                        $vbphrase[random_quote]
                </td><td class="tcat" align="right">
                        <div align="right">

                        (<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> | <a href="$vboptions[bburl]/quotes.php?do=editquote&quoteid=$randomquote[quoteid]">$vbphrase[edit_this_quote]</a>
                        </if>

                        | <a href="$vboptions[bburl]/quotes.php?do=list">$vbphrase[view_all_quotes]</a>)
                </div>
                          </td><td class="tcat" style="width:15px;">
                          <div style="float:right;" align="right">
                        <a 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></div>

                </td>
        </tr>
</thead>
<tbody id="collapseobj_forumhome_randomquote" style="$vbcollapse[collapseobj_forumhome_randomquote]">
        <tr><td class="alt1" width="30%"></td>
                <td class="alt1"><div style="font-style:italic;margin-right:10%;">
                <p>&quot;$randomquote[quote]&quot;</p>
                <p style="font-weight:bold;margin-left:25%;">- $randomquote[author]<if condition="$randomquote[context]"> ($randomquote[context])</if></p>
                </div>
                </td><td class="alt1" valign="top">
                        <a style="float:$stylevar[right];" href="$vboptions[bburl]/quotes.php?do=view&quoteid=$randomquote[quoteid]">#$randomquote[quoteid]</a>
                </td>

        </tr>
<if condition="$vboptions[ratequote]==3">
        <tr><td class="alt1" align="left" colspan="3">
        $vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
        </td>
</if>

<if condition="$vboptions[ratequote]==1">
        <tr><td class="alt1" align="left">
        $vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
        </td>
        <td class="alt1" align="right" colspan="2">$vbphrase[rate_this_quote]:
        <form name="rateplus" action="$vboptions[bburl]/quotes.php">
        <input type="hidden" name="do" id="do" value="rate" />
        <input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
        <input type="hidden" name="vote" id="vote" value="plus" />
        <input type="submit" value="+" class="vote" />
        </form>
        &nbsp;
        <form name="rateminus" action="$vboptions[bburl]/quotes.php">
        <input type="hidden" name="do" id="do" value="rate" />
        <input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
        <input type="hidden" name="vote" id="vote" value="minus" />
        <input type="submit" value="-" class="vote" /></form>
        </td>
</if>
<if condition="$vboptions[ratequote]==2">
        <tr><td class="alt1" align="left">
        $vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
        </td>
        <td class="alt1" align="right" colspan="2">$vbphrase[rate_this_quote]:
        <form name="voting" id="voting" action="$vboptions[bburl]/quotes.php">
        <input type="hidden" name="do" id="do" value="rate" />
        <input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
        <select name="vote" id="vote" onchange="document.voting.submit();">
        <option value=""></option>
        <option value="1">&nbsp;&nbsp;1&nbsp;&nbsp;</option>
        <option value="2">&nbsp;&nbsp;2&nbsp;&nbsp;</option>
        <option value="3">&nbsp;&nbsp;3&nbsp;&nbsp;</option>
        <option value="4">&nbsp;&nbsp;4&nbsp;&nbsp;</option>
        <option value="5">&nbsp;&nbsp;5&nbsp;&nbsp;</option>
        </select>
        </form>
        </td>
</if>

</tr>
</tbody>
</table><br />


Mr.Monkey 11-19-2005 01:43 PM

Hey Cap'n, good job on quoteit, but I've managed to break something. I had an old version of quoteit installed, but I reverted all the templates necessary afterwards.
When I try to submit a quote, I get the following error:
Code:


Database error in vBulletin 3.5.1:

Invalid SQL:

                INSERT INTO 1vb3_quotes
                (quote, author, userid, approved, context) VALUES
                ("Test", "Test", 1, 0, "");

MySQL Error  : Unknown column 'context' in 'field list'
Error Number : 1054
Date        : Saturday, November 19th 2005 @ 04:38:35 PM
Script      : http://www.tribeclown.com/vforum/quotes.php
Referrer    : http://www.tribeclown.com/vforum/quotes.php?&do=addquote
IP Address  : 146.115.44.37
Username    : Test
Classname    : vb_database

Any suggestions?

funinthesun 11-19-2005 02:44 PM

I've just installed this and it seemed easy enough to do, however nothing is showing up when I add a quote? When I click to view all quotes it just takes me to the submit quote form. I didn't add the submit posts code, should I of added that as well? The options for showing quotes is in my forum home page options in my admincp which turns it on and off fine but no quotes, what have I done wrong? Also, where can I view all quotes that have been entered in my admincp? Thanks

OneShot 11-19-2005 03:03 PM

Did you check in your AdminCP under Moderation -> Moderate Quotes? Because depending on your settings you have to approve them first.

funinthesun 11-19-2005 03:21 PM

Hi OneShot

No, I hadn't checked but I just looked now and there is no option in the moderation section to moderate posts?

Mr.Monkey 11-19-2005 05:37 PM

Quote:

Originally Posted by Mr.Monkey
Hey Cap'n, good job on quoteit, but I've managed to break something. I had an old version of quoteit installed, but I reverted all the templates necessary afterwards.
When I try to submit a quote, I get the following error:
Code:


Database error in vBulletin 3.5.1:

Invalid SQL:

                INSERT INTO 1vb3_quotes
                (quote, author, userid, approved, context) VALUES
                ("Test", "Test", 1, 0, "");

MySQL Error  : Unknown column 'context' in 'field list'
Error Number : 1054
Date        : Saturday, November 19th 2005 @ 04:38:35 PM
Script      : http://www.tribeclown.com/vforum/quotes.php
Referrer    : http://www.tribeclown.com/vforum/quotes.php?&do=addquote
IP Address  :
Username    : Test
Classname    : vb_database

Any suggestions?

Just in case anyone gets the same message, deleting it from the Plugins section, then reinstalling the .xml seems to have cleared the problem!

funinthesun 11-19-2005 06:32 PM

I'm stumped on this one, I don't know why the quotes aren't showing up. Could it be something to do with my version of mySQL? :(

TygerTyger 11-19-2005 07:03 PM

Quote:

Originally Posted by funinthesun
I'm stumped on this one, I don't know why the quotes aren't showing up. Could it be something to do with my version of mySQL? :(

Hard for anyone to say if you don't tell us what version it is ;)

Cap'n Steve 11-19-2005 07:41 PM

Quote:

Originally Posted by Mr.Monkey
Just in case anyone gets the same message, deleting it from the Plugins section, then reinstalling the .xml seems to have cleared the problem!

Be careful with that, as uninstalling the product will delete all your quotes. I think your original problem was that you had version 1.x installed and never upgraded to 2.0. As long as it works now it's ok, but I'll remember to take that into consideration for the install code.

funinthesun - If there's no "Moderate Quotes" link under Moderation, did you upload includes/xml/cpnav_quoteit.xml? To see quotes in the moderation que without the link, point your browser to admincp/quoteadmin.php?do=moderate

funinthesun 11-20-2005 12:08 AM

Hi Cap'n Steve

Yes, I uploaded the cpnav_quoteit.xml file to includes/xml. I thought it was a simple install to be honest. I've pointed my browser to http://www.mysite.com/quotes.php?do=moderate and it's just a blank white page? :confused:

Cap'n Steve 11-20-2005 03:29 AM

My fault. It's admincp/quoteadmin.php?do=moderate. :o

funinthesun 11-20-2005 09:23 AM

Ok, that worked an brought the page up for me, I found the two quotes that had been submitted and they were both set to ignore. When I clicked approve on both of them it said "Could not find phrase 'quote_x_has_been_approved'. :confused:

funinthesun 11-20-2005 09:25 AM

Also, moderate quotes is now showing up in the moderation section now but when I click on it, it says no quotes need moderation.

funinthesun 11-20-2005 09:34 AM

P.S Quoteit! Options is showing on the vbulletin options drop down now and the setting was set to not show random quote so that may be why it was showing up? I've still got the Quoteit! options in my vbulletion options -> forums home page options as well. OK, just changed it back to show random quote and tada it worked :D Thanks very much for your help :)

funinthesun 11-20-2005 09:37 AM

View all quotes in now also working and it shows up as viewing quotes in the who's online. Thanks again :)

TygerTyger 11-20-2005 11:43 AM

Sorry, forgot to say thanks for your help. Got it all smartened up, and in the end I just removed the voting mechanism from View All Quotes entirely so the if/else statement wasn't needed. There's always someone who likes to screw with the ratings and being able to vote so many times at once was too open to abuse IMO.

Great mod, thanks again.

funinthesun 11-20-2005 12:19 PM

Sorry, me again! Lol. Is there any way you can tell who's voted on the quotes?

Cap'n Steve 11-20-2005 10:50 PM

Quote:

Originally Posted by funinthesun
Sorry, me again! Lol. Is there any way you can tell who's voted on the quotes?

It's stored in the database, but there's no way to see it on the quotes page or the admin page yet.

Warrior 11-28-2005 05:48 PM

I had the same issue as Snort_2005 on page 7 of this thread. I think you should add to "Allow Overwrite" - I didn't do that and ended up with the same mySQL errors.

I have attached the upgrade XML that was edited per your instructions (page 7) and this worked perfectly. Thanks again for this hack!

[INSTALLED]

Mr.Monkey 11-29-2005 12:14 AM

Can anyone suggest what I should add into the "adv_portal_moderation" to get the link to the quotes to moderate to show correctly on my quick moderate module in vbAdvanced?

lexx27 11-29-2005 01:13 AM

I think there is a modification at vbadvanced page

Warrior 12-02-2005 12:02 PM

Quote:

Originally Posted by Mr.Monkey
Can anyone suggest what I should add into the "adv_portal_moderation" to get the link to the quotes to moderate to show correctly on my quick moderate module in vbAdvanced?

I am also interested in this... did I miss it somewhere?

Bubble #5 12-04-2005 05:17 AM

Quote:

Originally Posted by Cap'n Steve
The easy way to only allow administrators would be to edit quotes.php

Is there a way to only have admins add the quotes? The code above is only for editing the quotes. Maybe add a conditional before where it says "add a quote, show all quotes"? I'm not sure what the correct conditional would be though, or where to add it. Maybe in the templates? Thanks.

Gio Takahashi 12-04-2005 06:51 AM

HTML Code:

Database error in vBulletin 3.5.1:

Invalid SQL:

                                        UPDATE quotes SET
                                        votes = votes + 1,
                                        rating = rating + 2,
                                        average = rating / votes
                                                WHERE quoteid = 385;

MySQL Error  : Unknown column 'votes' in 'field list'
Error Number : 1054
Date        : Sunday, December 4th 2005 @ 12:50:29 AM
Script      : [url]http://www.unitedempire.net/forum//quotes.php?do=rate&quoteid=385&vote=2[/url]
Referrer    : [url]http://www.unitedempire.net/forum/index.php[/url]
IP Address  : 71.3.5.169
Username    : Gio Takahashi
Classname    : vb_database

BTW, I did have QuoteIt for Vb 3.0. Anyway, anything I can do to fix it? Should I just manually add the collumn or not?

Cap'n Steve 12-04-2005 07:27 PM

I'm guessing you had QuoteIt! 1.2 but never upgraded to 2.0, right? I never even considered that situation when I released this version. :ermm: The next version should handle the upgrade better, but until then these queries should fix it:

Code:

UPDATE $TPquotes ADD COLUMN (votes SMALLINT(10) UNSIGNED NOT NULL DEFAULT 0, rating MEDIUMINT(10) NOT NULL DEFAULT 0, average FLOAT(3, 2) NOT NULL DEFAULT 0.00, context VARCHAR(250))
Code:

ALTER TABLE $TPquotes ADD INDEX rating
Code:

ALTER TABLE $TPquotes ADD INDEX average
Just replace $TP with your table prefix.

Cap'n Steve 12-04-2005 07:52 PM

For those interested, I've added instructions for adding quotes to the vBadvanced quick moderation in this post.

Bubble #5 12-04-2005 10:47 PM

Why doesn't this hack work in the header?

We added $showrandomquote (as mentioned in this thread) and made the changes to the plugin, but it still doesn't show up :(

What would block it from showing up?

Cap'n Steve 12-04-2005 11:06 PM

To only allow administrators to add quotes, in quotes.php, find

PHP Code:

require_once('./global.php'); 

below that, add

PHP Code:

    if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'addquote' OR $_REQUEST['do'] == 'editquote' OR $_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'submitpost' OR $_REQUEST['do'] == 'submit') {
    if (!
$vbulletin->userinfo['permissions']['adminpermissions'])     {
        
print_no_permission();
        exit;
    }


I'm not sure about your other error, could you attach a saved html page where the quotes should be showing up in the header?

Gio Takahashi 12-05-2005 01:40 AM

Quote:

Originally Posted by Cap'n Steve
I'm guessing you had QuoteIt! 1.2 but never upgraded to 2.0, right? I never even considered that situation when I released this version. :ermm: The next version should handle the upgrade better, but until then these queries should fix it:

Code:

UPDATE $TPquotes ADD COLUMN (votes SMALLINT(10) UNSIGNED NOT NULL DEFAULT 0, rating MEDIUMINT(10) NOT NULL DEFAULT 0, average FLOAT(3, 2) NOT NULL DEFAULT 0.00, context VARCHAR(250))
Code:

ALTER TABLE $TPquotes ADD INDEX rating
Code:

ALTER TABLE $TPquotes ADD INDEX average
Just replace $TP with your table prefix.

a bit of an issue: I had to manually add in the columns because the syntax you gave does not seem to work.

Yes I replaced $TP with the correct table prefixes..well I don't use prefixes at all anyway >>.

none of the queries work at all.

Cap'n Steve 12-05-2005 03:57 AM

That's weird, do you remember the error it showed?

Bubble #5 12-05-2005 04:32 AM

Quote:

Why doesn't this hack work in the header?
Does anyone understand why this doesn't show up in the header? It will show up everyplace else, just not in the header area... :ermm:

Cap'n Steve 12-05-2005 06:10 AM

I don't know, could you attach the html page or post a link to your site?

Bubble #5 12-05-2005 09:57 PM

Quote:

Originally Posted by Cap'n Steve
could you attach the html page

Steve do you mean from view source? :ermm:

Scooterpig 12-05-2005 11:36 PM

Great hack and working fine for me but just wondering how do you add a heap of quotes so that each time a page is reloaded a new random quote shows up please?

Thank you..:)

Bubble #5 12-06-2005 12:18 AM

Quote:

Originally Posted by Intrepid
how do you add a heap of quotes

You add them in one by one...

Scooterpig 12-06-2005 01:22 AM

Quote:

Originally Posted by Bubble #5
You add them in one by one...

Bugga! Thanks.

Bubble #5 12-06-2005 01:47 AM

Quote:

Originally Posted by Intrepid
Bugga!

:nervous:

Maybe the good Cap'n will add it in as a (much needed) feature (hint, hint) :surprised:

Cap'n Steve 12-06-2005 04:25 AM

Quote:

Originally Posted by Bubble #5
Steve do you mean from view source? :ermm:

Either that or use File->Save.

I didn't think there was much demand for batch adding, but I could probably whip up some add-on to do it.

Bubble #5 12-06-2005 05:09 AM

This is what we are using. The 3 images are just background images.

HTML Code:

<table width="90%" cellpadding="0" cellspacing="0" align="center"><tr>
<td><img src="$stylevar[imgdir_misc]/left_quote.gif" alt="" border="0" /></td><td width="50%" align="center" class="quotebar">$vbphrase[quote_of_the_day]:&nbsp;$randomquote[quote]
</td>
<td width="50%" align="center" class="quotebar"></td>
<td><img src="$stylevar[imgdir_misc]/right_quote.gif" alt="" border="0" /></td>
</tr>
</table>

We're just trying to get the quote itself to appear. No table. No links for add/edit/delete ECT.

$randomquote[quote] seemed to work well anyplace else we put it, but unfortunately we only need it in the header... :ermm: Why doesn't it work there?

Cap'n Steve 12-07-2005 12:28 AM

Well I guess the best thing to do would be to change your quote_randomquote template to what you just posted, then follow the instructions for moving the Random Quote plugin to the Global Start hook and then just put $showrandomquote in the header template.


All times are GMT. The time now is 04:01 PM.

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.01693 seconds
  • Memory Usage 1,889KB
  • 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
  • (8)bbcode_code_printable
  • (3)bbcode_html_printable
  • (2)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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