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)

jaks 01-10-2006 02:51 PM

Cap'n
Could point me to the area where I need to edit and I will see if I can follow the bbcode parsing tutorial? I'll post how I make out good or bad. :S

Jaks

jaks 01-10-2006 03:29 PM

I'm not a coder at all and I know you said you don't know but do you think something like this as a plugin would work and if so where would I stick it in?


Update: Tried this in every quoteit related hook i could find. Did absolutely nothin

PHP Code:

if (!is_object($bbcode_parser))
    {
        require_once(
DIR '/includes/class_bbcode.php');
        
$bbcode_parser =& new vB_BbCodeParser($vbulletinfetch_tag_list());
    }
     
$randomquote['value'] = $bbcode_parser->parse($randomquote["context"],0true); 

I just editted from the following code:
PHP Code:

  <?xml version="1.0" encoding="ISO-8859-1" ?> 
- <product productid="myspace_style_profile" active="1">
  <title>Parse BBCode in Custom Profile Fields</title> 
  <description>Give your users the full effect by letting them use BB Code in their profile.</description> 
  <version>1.1</version> 
  <codes /> 
  <templates /> 
- <plugins>
- <plugin active="1">
  <title>Parse BBCode for Custom Profile Fields</title> 
  <hookname>member_customfields</hookname> 
- <phpcode>
- <![CDATA[ 
if (!is_object($bbcode_parser))
    {
        require_once(DIR . '/includes/class_bbcode.php');
        $bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
    }
     $profilefield['value'] = $bbcode_parser->parse($userinfo["$profilefieldname"],0, true);

  ]]> 
  </phpcode>
  </plugin>
  </plugins>
  <phrases /> 
  <options /> 
  </product>


BrandiDup 01-10-2006 04:23 PM

Installed on 3.5.3 and working perfectly.

Thank you very much for sharing this with us!

jaks 01-10-2006 05:11 PM

ok I figured out a way to manipulate the templates to link to a specific post. This is not by any means a great alternative but as I said before it works for me.

First I am only allowing admin to post these because it's bound to get too many broke links. So first I added permission tags around the "Add New Quote" link in the quote_randomquote and quote_listquote templates

Then I editted
PHP Code:

$randomquote[context

inquote_randomquote and quote_listbit.

K first the changes

( I didn't think to to copy the code prior to posting this so you might have to search by eye instead of with a text search. Not a very big templates anyway )
Find in quote_listbit template
PHP Code:

<if condition="$randomquote[context]">
            ( 
$randomquote[context] )
        </if> 

Change to fit your url (((Make sure you edit it)))
PHP Code:

<if condition="$randomquote[context]">
            <
a href="http://www.yoursite.com/your forum folder/showthread.php?t=$randomquote[context]">Read Moreimage anything you want!!</a>
        </if> 

Save and close

Next in the inquote_randomquote template ( If you only want to allow admin to submit quotes) **Recommended if you use this linking mod**
Find
PHP Code:

$vbphrase[add_a_quote

Change to
PHP Code:

<if condition="$vbulletin->userinfo['permissions']['adminpermissions']"><a href="$vboptions[bburl]/quotes.php?do=addquote">$vbphrase[add_a_quote]</a></if> 

Then find
PHP Code:

<p style="font-weight:bold;margin-left:25%;">- <if condition="$randomquote[context]">$randomquote[context]</if></p

Change it same as the last template
PHP Code:

<p style="font-weight:bold;margin-left:25%;">- <if condition="$randomquote[context]"> <a href="http://www.yoursite.com/your forum foldershowthread.php?t=$randomquote[context]">Read More</a></if></p

Next in the quote_listquote template
Find
PHP Code:

(<a href="quotes.php?$session[sessionurl]&do=addquote">$vbphrase[add_a_quote]</a> ) 

Change to
PHP Code:

<if condition="$vbulletin->userinfo['permissions']['adminpermissions']">(<a href="quotes.php?$session[sessionurl]&do=addquote">$vbphrase[add_a_quote]</a> - </if> 

Now to link to a post all you need to do is enter just the thread ID# in the context field.
Example: You want to link to this thread below all you need to enter is 8 in the context field.
PHP Code:

http://www.trulyunusual.com/wards/showthread.php?t=8 

Alternatively you could set it up so it will link to external pages aswell very easily. Just play with it. BTW I removed the ( and ) because they are cosmetic and interfer when trying to link.

Hope this helps some one.
This hack be used in many applications. Random images, random links, random facts with read more etc... :D

Your the best Cap'n
Jaks

jaks 01-10-2006 05:46 PM

This is how it would look for external links ( I use author as my title and not user so if you dont need the title in there chage it to suit your needs.)
PHP Code:

<a title="$randomquote[author]href="$randomquote[context]">Read More</a

Jaks

Robbed 01-10-2006 10:15 PM

Quote:

Originally Posted by Cap'n Steve
jaks - Parsing bbcode would require you to modify the code, and I can't really help you since I haven't gotten around to learning how to do it myself.

What if you made the quote text box a wysisyg editor box? that way it would parse the code. I've seen it done on a few hacks.

Cap'n Steve 01-10-2006 10:38 PM

You'd still need to convert the bbcode to HTML when people view the quote. Since there are no hooks in the hack yet, you'd have to parse it in quotes.php before it's printed out to the page.

jaks 01-10-2006 11:47 PM

Quote:

Originally Posted by Cap'n Steve
You'd still need to convert the bbcode to HTML when people view the quote. Since there are no hooks in the hack yet, you'd have to parse it in quotes.php before it's printed out to the page.

Wish I could figure it out but the work around I did does the trick.
:D

Jaks

Robbed 01-11-2006 12:02 AM

This is what they did for the downloads hack if it helps any

https://vborg.vbsupport.ru/showpost....&postcount=256

jaks 01-11-2006 12:20 AM

I tried to match stuff up and figure it out but it's a weeee bit over my head lol. Looks pretty straightforward until the db stuff. :S

tarot 01-13-2006 12:47 AM

Quote:

Originally Posted by Cap'n Steve
tarot - I think it is the Forumdisplay template. As for the second step, go to your Plugin Manager, edit the plugin called "Random Quote", change the hook to "global_start" and add that piece of code at the end.

jaks - Parsing bbcode would require you to modify the code, and I can't really help you since I haven't gotten around to learning how to do it myself.

Thank you Cap'n Steve, that did it, one more silly question how would I do multiple forums. I repeated the if line and changed the variable it worked but I'm sure it is really dirty. I tried commas and spaces neither worked, I bet it is a semicolon am I right? Thanks again.

Cap'n Steve 01-13-2006 02:33 AM

Try something like this:

HTML Code:

<if condition="in_array($_REQUEST['f'], array(forumid1, forumid2, forumid3))">$showrandomquote</if>

NoPonies 01-17-2006 12:36 PM

Quote:

Originally Posted by Cap'n Steve
Try something like this:

HTML Code:

<if condition="in_array($_REQUEST['f'], array(forumid1, forumid2, forumid3))">$showrandomquote</if>

Thank you very much I will put that in.

Dolamite 01-22-2006 10:59 PM

i installed it.... and it worked.... then for reasons i cannot explain.... it now says this

Database error in vBulletin 3.5.3:

Invalid SQL:

SELECT COUNT(*) AS count FROM quotes AS quotes
WHERE approved = 1 AND quotes.average >= 0 AND quotes.rating >= 0;

MySQL Error : Unknown column 'quotes.average' in 'where clause'
Error Number : 1054

Cap'n Steve 01-23-2006 01:06 AM

Run this query and tell me what it says:

Code:

SHOW CREATE TABLE $TPquotes
Replace the $TP with your table prefix.

Dolamite 01-23-2006 04:26 PM

i don't use a table prefix so i ran it as $quotes.... got some error...

anyways i uninstalled, and reinstalled... and it works again.... but... now i'm wondering if that reinstall.... wiped all my old quotes? And if so... I have the old database.... so it must be possible to import them somehow....

Cap'n Steve 01-24-2006 04:26 AM

You should also have removed the dollar sign. Uninstalling will delete all your quotes, but if you have the backup you can restore your quotes table through phpMyAdmin or just run all the queries.

majoreyeswater 01-24-2006 01:51 PM

Quote:

Originally Posted by Alien
In moderation, when I attempt to moderate one (happens in delete, or approve) I get this:

Could not find phrase 'quote_x_has_been_approved'.

Aside from the missing phrase, it approves or deletes properly.

I also get this, can anyone advise where I can amend it.

Also, and atthe risk of looking extremely dim, what are the following for:

Average Threshold and Total Threshhold. Also, what does 'enable context' do? Is that for BB code?

Any help appreciated.

Cap'n Steve 01-24-2006 09:59 PM

Don't worry about the phrase, it's harmless.

An explanation of those options is in this post.

majoreyeswater 01-25-2006 06:30 AM

Quote:

Originally Posted by Cap'n Steve
Bubble #5 - Sorry, it explains it under the Forum Home Options, but not under the QuoteIt! Options, here's an explanation:

Total Threshold - Quotes won't show up as the Random Quote unless their total rating is at least this number.

Average Threshold - Quotes won't show up as the Random Quote unless their average rating is at least this number.

Context - This is just an extra text box where users can include extra information, like where the quote came from.

Thanks for that, and sorry if I am going over old ground, but my questions is:

If they aren't allowed to show up in random posts until a certain rating is received, how do they appear at all to get their rating? I suppose I had just better try the threshold options and see what happens.

Thanks for this feature, really adds to the site.

Cap'n Steve 01-25-2006 07:58 AM

They'll still show up when browsing the list of quotes, just not in the random quote on your forum home page.

Dolamite 01-28-2006 06:14 PM

Quote:

Originally Posted by Cap'n Steve
Run this query and tell me what it says:

Code:

SHOW CREATE TABLE $TPquotes
Replace the $TP with your table prefix.


Code:

quotes          CREATE TABLE `quotes` ( `quoteid` int(10) unsigned NOT NULL auto_increment, `quote` mediumtext NOT NULL, `author` mediumtext NOT NULL, `userid` int(10) unsigned NOT NULL default '0', `approved` smallint(5) unsigned NOT NULL default '0', PRIMARY KEY (`quoteid`), KEY `approved` (`approved`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1

Cap'n Steve 01-29-2006 06:20 AM

You somehow reverted to the old quotes table. Run these queries to fix it, replacing $TP with your table prefix:

Code:

ALTER TABLE $TPquotes ADD COLUMN votes int (5) unsigned not null default 0
Code:

ALTER TABLE $TPquotes ADD COLUMN rating int (10) not null default 0
Code:

ALTER TABLE $TPquotes ADD COLUMN average float (3, 2) not null default 0.00
Code:

ALTER TABLE $TPquotes ADD COLUMN context varchar (250)

Dolamite 01-29-2006 10:36 PM

sweet man... fixed it...appreciate your help

HumourForum.com 02-03-2006 09:02 PM

Great! However is there anyway I can make the random quote bit smaller? Thanks.

Cap'n Steve 02-04-2006 02:11 AM

You'd have to edit the quote_randomquote template and rearrange it to your liking.

S@NL - BlackBik 02-04-2006 09:25 AM

Thanks Cap'n Steve, installed and works fine :)

S@NL - BlackBik 02-18-2006 10:52 PM

I've made a little modification that shows the name and avatar of the user that posted a quote. This is only shown in the random quote at forumhome. Maybe someone else also likes this so I thought to share it with you people :)
Here goes:
Open the phrasemanager and add a new global phrase "added_by".
Open the plugin "Random Quote" and find:
Code:

        eval('$showrandomquote = "' . fetch_template('quote_randomquote') . '";');
(this is at the bottom of the code)
Above it, insert:
Code:

                require_once('./includes/functions_user.php');
                $userinfo[avatarurl] = fetch_avatar_url($randomquote[userid]);
                if (!$userinfo[avatarurl]) {
                    $userinfo[avatarurl] = "";
                } else {
                    $userinfo[avatarurl] = $vbulletin->options['bburl'] . '/' . $userinfo[avatarurl][0];
                }

Save the plugin and open the templates editor and the template: "quote_randomquote".
Find
Code:

<tr><td class="alt1" width="30%"></td>
and replace by:
Code:

<tr><td class="alt1" width="20%">$vbphrase[added_by]:<br>
                        <if condition="$userinfo[avatarurl]">
                                <a href="member.php?u=$randomquote[userid]"><img src="$userinfo[avatarurl]" border="0" alt="$randomquote[username]" height="50" width="50"/>
                        </if></a>
<a href="$vboptions[bburl]/member.php?userid=$randomquote[userid]">$randomquote[username]</a></td>

And you're done :)
Check http://forum.seti.nl/ for a demo.

Enjoy

Thanks go to amykhar, cause I used part of her code from her avatar on WOL hack :)

HumourForum.com 02-18-2006 10:55 PM

Awesome! Thanks for sharing!

kizzmet 02-27-2006 12:46 AM

I am running vb 3.5.4 and CMPS v2

Everything works fine in the forum, and it shows up in moderation sections, it also kept the old quotes from my previous version which is awesome. Over all I cannot thank you enough for posting this Captain.

The problem I am having is this:

When I create the module for the CMPS home page, I follow your directions but when I hit Save or whatever, I get this message:

You already have a Module with an identifier of ''. Please select a different identifier.

Any ideas? I checked the modules page and no I don't already have anything for quote it in there. And I reverted my old quote it templates before installing.

I appreciate any thoughts on it.

Cap'n Steve 02-27-2006 05:12 AM

Does it actually say the identifier is blank? Can you take and post a screenshot of the values you have filled out before you hit save?

kizzmet 02-27-2006 06:05 PM

Quote:

Originally Posted by Cap'n Steve
Does it actually say the identifier is blank? Can you take and post a screenshot of the values you have filled out before you hit save?

Here you go..the fields I enter and the results it gives me.

Cap'n Steve 02-28-2006 03:26 AM

Just put whatever you want in the Identifier field. I suggest "Random Quote".

kizzmet 02-28-2006 12:43 PM

*sigh* so simple too. That worked thank you.

And noticing the 18 pages of questions and you being on the ball to answer each one, thanks for doing such an awesome job. Your hack is great and your support is great. *cheers*

Torqued 02-28-2006 04:26 PM

I upgraded from vB 3.0.7 -> 3.5.4.

What do I need to do to upgrade this mod? When I try to run the install xml, I get this:

Invalid SQL:

INSERT INTO datastore
(title, data) VALUES
("quote_settings", "1:0::1:5:0:::");

MySQL Error : Duplicate entry 'quote_settings' for key 1
Error Number : 1062

I'd really like to not lose all my quotes. :(

tnx

Cap'n Steve 03-01-2006 02:11 AM

Try using this instead of the version in the zip file:

Torqued 03-01-2006 11:46 PM

Thanksk, Cap'n Steve! That worked!!

Christie189 03-02-2006 03:17 PM

Awesome hack!

Is there anyway to make this so that guests/unregistered users wouldn't be able to see it on my main page? Thanks in advance. :)

Oh and also, in the postbit. How do I change the link (submit to quotes) to an image?

S@NL - BlackBik 03-02-2006 08:14 PM

Quote:

Originally Posted by Christie189
Is there anyway to make this so that guests/unregistered users wouldn't be able to see it on my main page? Thanks in advance. :)

As far as I know not at this moment.
Quote:

Originally Posted by Christie189
Oh and also, in the postbit. How do I change the link (submit to quotes) to an image?

First make an image. Then upload it to directory images/_s2/buttons on your server, where _s2 is the dir for your style.
Then edit the link like this:
Code:

<!-- hack: BEGIN QuoteIt! -->
<a href="$vboptions[bburl]/quotes.php?$session[sessionurl]do=submitpost&amp;postid=$post[postid]"><img src="$stylevar[imgdir_button]/quoteit.gif" alt="$vbphrase[submit_to_quotes]" border="0" /></a>
<!-- END QuoteIt! -->


Cap'n Steve 03-03-2006 05:19 AM

To hide the quote from guests, in your FORUMHOME template find
HTML Code:

$showrandomquote
and replace it with
HTML Code:

<if condition="$vbulletin->userinfo[userid]">
$showrandomquote
</if>



All times are GMT. The time now is 03:59 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.01720 seconds
  • Memory Usage 1,880KB
  • 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
  • (12)bbcode_code_printable
  • (4)bbcode_html_printable
  • (13)bbcode_php_printable
  • (10)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