vbJokes

Feckie

New Member
VBjokes what is it.

Well vbjokes is a jokes database system for holding all your jokes in one place.

with vbjokes the user can search for a joke or just look around in the categorys.

All members of the site will be able to add a joke to the database but the admin will have to approve the joke before anyone on your site can see it.

The user has the option to view the jokes in a popup and by clicking the image if the joke has one to see the larger picture.

The users can now rate a joke out of 5 this now uses images to show the rating.

The admin can do

The admin can add new categorys edit or delete them.

View edit delete jokes.

Approve new jokes.

Turn vbjokes on or off.

=====================================

Install notes

Installation
1. Upload files as-is to board but not the product-vbjokes.xml file.

2. Log into admincp, Goto Plugin System then manage pruducts click [Add/Import Product]
then inport the product-vbjokes.xml file.

3. navigate back into admincp, (might need a refresh to get nav options)

4. click vbjokes, then vbjokes settings, activate vbjokes

5. Edit navbar in navigation / breadcrumb templates
**************************************************************
Find
**************************************************************
<td class="vbmenu_control"><a href="memberlist.php$session[sessionurl_q]">$vbphrase[members_list]</a></td>
**************************************************************
Add under
**************************************************************
<td class="vbmenu_control"><a href="vbjokes.php">VBjokes</a></td>
**************************************************************

6. login to admincp
goto Plugin System
Manage Products
[Add/Import Product]
EITHER upload the XML file from your computer product-vbjokes-upgrade.xml
Allow Overwrite yes
click inport

7. All done enjoy your vbjokes hack.

*********************************************************

Please Note There Is A Security Vulnerability In This (Use @ own risk)

*********************************************************
 
hi where am i going wrong with this as keep getting this on it

Database error in vBulletin 3.7.4:

Invalid SQL:
SELECT * FROM vbjokes_jokes WHERE aprove = 0;

MySQL Error : Table 'dbname.vbjokes_jokes' doesn't exist
Error Number : 1146
Request Date : Wednesday, November 26th 2008 @ 11:23:40 PM
Error Date : Wednesday, November 26th 2008 @ 11:23:40 PM
Script : site
Referrer : site
IP Address : 26.32.2.01
Username : bob the
Classname : vB_Database
MySQL Version : 5.0.67-community-log
 
Ok guys 1st of all I'M NOT A PROGRAMMER but i made it working.

There are 2 steps to make it working.
First you import product-vbjokes_import1
Then you import product-vbjokes-upgrade_import2

the "_import1" and "_import2" are here to let you know the order in which you have to follow...

Then it should be working...

What i did ?
I think i found out the error caused when creating the vbjokes_jokes table...
It was an error on line 33...
jokecatid int(20) NOT NULL default '',
in which a 0 was missing...so the correct one should be...
jokecatid int(20) NOT NULL default '0',

Either you will have to put a 0 in this line (on your already downloaded file)...or you can use my product-vbjokes_import1

I really hope i made myself clear about how i managed to make it work on my situation :)

NEW EDIT!
Guys! Also you should be informed that the gifs (on images\vbjokes\stars folder) need to be renamed in this form...whenever you see 1.0 it should be renamed to 1,1 so it's not a . but a ,
So you must manually rename images to 1,1.gif 1,2.gif etc etc...
 
The only thing i would like to ask Feckie or any other person, is how can we make it so people who add jokes, their posted jokes would be shown immediatelly without admin's approval, it would save admin's life such an action...
 
leonpadi said:
The only thing i would like to ask Feckie or any other person, is how can we make it so people who add jokes, their posted jokes would be shown immediatelly without admin's approval, it would save admin's life such an action...

As Far as I Know you Can't
 
Any coder please? It wouldn't be so hard to be edited the vbjokes.php so all posts are immediately shown to public, without admin's acceptance...
It is a little anoying on big forums...
 
leonpadi said:
Any coder please? It wouldn't be so hard to be edited the vbjokes.php so all posts are immediately shown to public, without admin's acceptance...
It is a little anoying on big forums...



Ok I have a way around it...

1: Replace template JOKES with..
Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle] - $pagetitle</title>
$headinclude
</head>
<body>
$header

$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
		<tr>
			<td class="tcat">
				<span class="smallfont"><a href="vbjokes.php?$session[sessionurl]">$vboptions[bbtitle] Jokes </a></span>
			</td>
		</tr>
		
		  
		<tr align="left">
		  <td class="alt1"><span clas="smallfont">$vbphrase[vbjokes_welcome_page] </span></td>
		  </tr>
		 
	<tr align="left">
	<td  class="tcat"><span clas="smallfont">

	  <A href="vbjokes.php?do=category">$vbphrase[vbjokes_categorys_link]</A> <a href="vbjokes.php?do=cats"></a>&nbsp;|&nbsp;

	<a href="vbjokes.php?do=searchjoke">$vbphrase[vbjokes_search_joke_link]</a>&nbsp;|&nbsp;

	<a href="vbjokes.php?do=addjoke">$vbphrase[vbjokes_addjoke_link]</a>
	</td>
  </tr>
	</table>
<div style="padding: 5px 5px 5px 5px;">

	  $current
	</div>
	<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
		<tr>
			<td class="tcat">
				<span class="smallfont">$vbphrase[vbjokes_newest_jokes]</span>
			</td>
			<td class="tcat">
				<span class="smallfont">$vbphrase[vbjokes_topviewed_jokes]</span>
			</td>
			<td class="tcat">
				<span class="smallfont">$vbphrase[vbjokes_toprated_jokes]</span>
			</td>
		</tr>
		<if condition="!$newjokesbits">
	<tr><td class="alt1" align="center" width="33%">
	$vbphrase[vbjokes_nonew_jokes]
	</td>
	<td class="alt1" align="center" width="33%">
	$vbphrase[vbjokes_notopviewed_jokes]
	</td>
	<td class="alt1" align="center" width="33%">
	$vbphrase[vbjokes_notoprated_jokes]
	</td>
	</tr>
	<else />
	<td class="alt1" align="center" width="33%">
	$newjokebit
	</td>
<td class="alt1" align="center" width="33%">
$topjokebit
</td>
<td class="alt1" align="center" width="33%">
$topratedjokebit
</td>
</tr>
</if>  
	</table>
	
$footer
</body>
</html>

2: Replace vbjokes.php with the version supplied....

3: Run an sql query

Code:
UPDATE vbjokes_jokes SET aprove = 0;


This then works



Main zip file updated to allow for this post and post 4
 
Unfortunatelly even if it shows you the joke you posted,downside the list, it's still waiting for admin's approval inside admin's cp.
Also, it doesn't shows your posted joke in the list of already approved jokes...
 
leonpadi said:
Unfortunatelly even if it shows you the joke you posted,downside the list, it's still waiting for admin's approval inside admin's cp.
Also, it doesn't shows your posted joke in the list of already approved jokes...

but if you run the Run an sql query, it unaproves all your jokes.
And by altering the template and Replacing vbjokes.php it will show all jokes on the forum.
Therefore you don't have to approve the jokes, if you go to includes / xml / cpnav_vbjokes.xml and delete the following

Code:
		<navoption displayorder="2">
			<text>Approve New Jokes</text>
			<link>vbjokes_admin.php?do=unapproved</link>
		</navoption>

there is then no approve option in the admin cp...


And what you wanted was "so all posts are immediately shown to public, without admin's acceptance..." and I think that covers your requirements... ;)
 
Indeed , but it only shows 3 of all the jokes posted.
Look on this screenshot plz.
We have posted 5 jokes , but still it shows only 3 of them without any option for next page or something...
vbjokeszs9.jpg
 
leonpadi said:
Indeed , but it only shows 3 of all the jokes posted.
Look on this screenshot plz.
We have posted 5 jokes , but still it shows only 3 of them without any option for next page or something...
vbjokeszs9.jpg

because it is only set to show the first 3 of each section.

Ok how to change, open vbjokes.php, and find The First instance of....

Code:
$topviewedjokes = $db->query("SELECT * FROM " . TABLE_PREFIX . "vbjokes_jokes WHERE aprove=0 ORDER BY hits DESC LIMIT 0 , [color=Red]3[/color]");
$topviewedjoke=$db->num_rows($topviewedjokes);
$newjokes = $db->query("SELECT * FROM " . TABLE_PREFIX . "vbjokes_jokes WHERE aprove=0 ORDER BY jokeid DESC LIMIT 0 , [color=Red]3[/color]");
$newjoke=$db->num_rows($newjokes);
$topratedjokes = $db->query("SELECT * FROM " . TABLE_PREFIX . "vbjokes_jokes WHERE aprove=0 ORDER BY rating/numberOfVotes DESC LIMIT 0 , [color=Red]3[/color]");
$topratedjoke=$db->num_rows($topratedjokes);
This will show the amount on the First page, if you require the same amount on all pages change all of the other instances (there are about 8)
And change the Red number to the amount that you require to show...


If you also click Categories it will take you to the Categories you set up in the Admin cp... then click the categorie for the jokes in that Categorie
 
Back
Top