vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   vBaffiliates5 - Allow Users to Add & Edit their Own Affiliate Links!!! (https://vborg.vbsupport.ru/showthread.php?t=47008)

DarkDraco07 12-29-2002 06:30 AM

can anyone tell me how to make it show more than 1 banner?
i changed the LIMIT 1 but it still shows 1

C.Birch 12-29-2002 09:21 AM

im having a really big prob adding anything to my database via phpmyadmin

eg try adding:

INSERT INTO settinggroup (settinggroupid,title,displayorder) VALUES (32,'vBaffiliates','99')


Get:
Error
SQL-query : [Edit]

INSERT INTO settinggroup (settinggroupid,title,displayorder) VALUES (32,\'vBaffiliates\',\'99\')

MySQL said:


You have an error in your SQL syntax near '\'vBaffiliates\',\'99\')' at line 1


Try:
CREATE TABLE `vbaffiliates` (
`linkid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR(100) NOT NULL,
`link` VARCHAR(150) NOT NULL,
`b_link` VARCHAR(150) NOT NULL,
`moderated` smallint(6) DEFAULT '0' NOT NULL,
`height` smallint(6) NOT NULL,
`width` smallint(6) NOT NULL,
`hits` smallint(6) DEFAULT '0' NOT NULL,
`userid` smallint(6) NOT NULL
) TYPE = MYISAM;


Get:
Error
SQL-query : [Edit]

CREATE TABLE `vbaffiliates` (
`linkid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR(100) NOT NULL,
`link` VARCHAR(150) NOT NULL,
`b_link` VARCHAR(150) NOT NULL,
`moderated` smallint(6) DEFAULT \'0\' NOT NULL,
`height` smallint(6) NOT NULL,
`width` smallint(6) NOT NULL,
`hits` smallint(6) DEFAULT \'0\' NOT NULL,
`userid` smallint(6) NOT NULL
) TYPE = MYISAM;

MySQL said:


You have an error in your SQL syntax near '\'0\' NOT NULL,
`height` smallint(6) NOT NULL,
`width` smallint(6) NOT NULL,
' at line 6


can someone help its doing it for almost everything i try that needs database work but it never used to :(

Chris M 12-29-2002 11:12 AM

Hmmm...

Perhaps you should install FireFly's "SQL Query via Admin CP" Hack...

All I can say is that the queries worked for me, but it looks like your phpmyadmin may have a problem...

Is it just this hack, or does it do it for others?

@DarkDraco07 - I am sure that changing the LIMIT value should work...

Satan

DarkDraco07 12-29-2002 01:05 PM

i changed the limit to 99 and it still only shows 1 banner

DarkDraco07 12-29-2002 01:08 PM

btw, i put the $affiliate var on the myvbindex page. does that have anything to do with my prob?

Chris M 12-29-2002 01:10 PM

Indeed...

I shall look into it...

Satan

DarkDraco07 12-29-2002 04:36 PM

i tried puttin it on my forumhome template but it still shows 1

Chris M 12-29-2002 05:56 PM

@DarkDraco07 - I am releasing v4 soon, which has the option for this and much more:)

Satan

Chris M 12-29-2002 06:35 PM

v4 Released!

vBaffiliates4 has been released!

It includes a Banner List Page (with randomnly generated banners), a Limit to the Number of Banners to List on the page, and the Support for an Admin Options controlled Number of Banners to show:)

Satan

kevo 12-29-2002 07:46 PM

::clicks install::.. This looks great.. Is there going to be any other future versions?

NTLDR 12-29-2002 08:05 PM

*lol* A version a day it seems hellsatan is going for ;)

kevo 12-29-2002 08:27 PM

Database error in vBulletin 2.2.9:

Invalid SQL: SELECT * FROM vbaffiliates ORDER BY linkid LIMIT
mysql error: You have an error in your SQL syntax near '' at line 1

mysql error number: 1064

Date: Sunday 29th of December 2002 05:22:53 PM
Script: http://www.enactive.net/forums/forum...hp?action=list
Referer: http://www.enactive.net/forums/


I get this error. Any help?

DrkFusion 12-29-2002 08:31 PM

Quote:

Originally posted by NTLDR
*lol* A version a day it seems hellsatan is going for ;)
So you noticed too? heh

Chris M 12-29-2002 09:43 PM

@kevo - Yup...There should be at least one more version;)

That file you've got looks wrong:(

Send it to me in a PM;)

Satan

DarkDraco07 12-30-2002 05:42 AM

works now :)

Chris M 12-30-2002 08:49 AM

Goody good:)

Satan

C.Birch 12-30-2002 09:17 AM

Quote:

Originally posted by C.Birch
im having a really big prob adding anything to my database via phpmyadmin

eg try adding:

INSERT INTO settinggroup (settinggroupid,title,displayorder) VALUES (32,'vBaffiliates','99')


Get:
Error
SQL-query : [Edit]

INSERT INTO settinggroup (settinggroupid,title,displayorder) VALUES (32,\'vBaffiliates\',\'99\')

MySQL said:


You have an error in your SQL syntax near '\'vBaffiliates\',\'99\')' at line 1


Try:
CREATE TABLE `vbaffiliates` (
`linkid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR(100) NOT NULL,
`link` VARCHAR(150) NOT NULL,
`b_link` VARCHAR(150) NOT NULL,
`moderated` smallint(6) DEFAULT '0' NOT NULL,
`height` smallint(6) NOT NULL,
`width` smallint(6) NOT NULL,
`hits` smallint(6) DEFAULT '0' NOT NULL,
`userid` smallint(6) NOT NULL
) TYPE = MYISAM;


Get:
Error
SQL-query : [Edit]

CREATE TABLE `vbaffiliates` (
`linkid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR(100) NOT NULL,
`link` VARCHAR(150) NOT NULL,
`b_link` VARCHAR(150) NOT NULL,
`moderated` smallint(6) DEFAULT \'0\' NOT NULL,
`height` smallint(6) NOT NULL,
`width` smallint(6) NOT NULL,
`hits` smallint(6) DEFAULT \'0\' NOT NULL,
`userid` smallint(6) NOT NULL
) TYPE = MYISAM;

MySQL said:


You have an error in your SQL syntax near '\'0\' NOT NULL,
`height` smallint(6) NOT NULL,
`width` smallint(6) NOT NULL,
' at line 6


can someone help its doing it for almost everything i try that needs database work but it never used to :(

I worked out what it was i already have in the data base useing the settings number 32 and 99 so i just edited them to 33 and 98 and it works fine now.

Chris M 12-30-2002 09:48 AM

Hmmm...

I'm glad that it worked, but you don;t usually get an SQL Syntax error for a duplicate Setting:confused:

Ah well...As long as it worked for you:)

Satan

cklaszlo 12-30-2002 01:01 PM

I'm getting an error now too:

Invalid SQL: SELECT linkid,name,link,b_link,height,width,hits,userid FROM vbaffiliates WHERE moderated='1' ORDER BY RAND() LIMIT
mysql error: You have an error in your SQL syntax near '' at line 1


I restored a backup Global.php :)

NTLDR 12-30-2002 04:15 PM

Quote:

Originally posted by hellsatan
Hmmm...

I'm glad that it worked, but you don;t usually get an SQL Syntax error for a duplicate Setting:confused:

You should set the script so that it uses the next avalible ids and use $DB_site->insert_id() to get the id to use in the rest of the settings.

Chris M 12-30-2002 04:39 PM

@cklaszlo - The upgrade script only works from v3 to v4 - Any prior versions to v3, such as for v2 or v1, you should use the New Install file for instructions;)

@NTLDR - Good idea:)

Satan

DarkDraco07 01-01-2003 05:42 AM

i got somethin for ya to do, instead of having someone go through the whole registering process, have them go through a quick register. like user name, password, email, site link, banner link

Chris M 01-01-2003 09:54 AM

Hmmmm...

But g-force made a Quick Register hack;)

Satan

DarkDraco07 01-01-2003 11:57 AM

can u make the quick register just for this though :p

Chris M 01-01-2003 12:19 PM

I suppose I could;)

Satan

colicab-d 01-02-2003 05:01 PM

would it poss to make this into a self installing script :p so that folk dont need to install it manually (i.e adding sql queries etc)

Chris M 01-02-2003 05:15 PM

Sure:)

I've been trying to work a script to do this, and I reckon I can get it to:)

Gimme till next weekend to sort it;) (Knowing me it will be done tomorrow:p)

Satan

colicab-d 01-02-2003 05:40 PM

lol kool cause im really wantin to use this hack on me site :D

also how would i go about displaying say 5 links on my home (vbindex) is there a way to do it and can i have them listed horizontally?

I think also this would be kool (dont mean to sound rude its already an excellent hack)

If u can set it up so its displayed on a page in categories with maybe the top ten (maybe set in admin) of each showing a banner (in rows) and the rest in just plain link form :D

thnx again lol

Chris M 01-02-2003 05:47 PM

You mean all of them?

I can do a page with the "Top 10 visited" banners, and then others ordered by number of Hits:)

Satan

colicab-d 01-02-2003 08:10 PM

i just thought it may be good to display certain links as text as if its a high amount of images it may be upsetting for 56k users :p

Tho for the text links it may be a good idea to show a random set amount :S

Chris M 01-02-2003 09:39 PM

I see:)

Maybe the Top 5 should be Images (the banners), the 6-10 should be Bolded links, and the rest are randomnly generated?:)

Satan

Logik 01-02-2003 10:52 PM

That would be great. but what i think hes saying is. On his forum home. VBINDEX.. He wants to have the top 5 displayed on there in text.. I believe thats what hes saying.

Chris M 01-03-2003 07:31 AM

That is doable:)

As long as it is vBindex not vBhome - I'm not sure how to integrate it now...

Satan

colicab-d 01-03-2003 04:55 PM

no i just need say a random 5 on my home :D and its vbindex ;)

Chris M 01-03-2003 07:27 PM

Ok:)

Let me check the file and post a modification for you:)

Satan

colicab-d 01-03-2003 08:02 PM

great dude thnx hey add me on msn if u got it :)

Chris M 01-03-2003 08:29 PM

Added you:)

Satan

DarkDraco07 01-26-2003 02:31 AM

how come this is adding 2 queries per page? how can i make it only add queries to my homepage, not all

Chris M 01-26-2003 11:03 AM

@DarkDraco07 - It depends where you want it to show...;)

By default, I made it globalised, so you can add it to your header template:)

If you want it to only add to index, revert the global.php change, remove the variable from the header template, and add it to the forumhome template...

Then open forum/index.php (this is untested)
Find:
Code:

// if user is know, then welcome
if ($bbuserinfo['userid']!=0) {
  $username=$bbuserinfo['username'];
  eval("\$welcometext = \"".gettemplate('forumhome_welcometext')."\";");
  eval("\$logincode = \"".gettemplate('forumhome_logoutcode')."\";");
  eval("\$newposts = \"".gettemplate('forumhome_newposts')."\";");

} else {
  $welcometext = "";
  eval("\$newposts = \"".gettemplate('forumhome_todayposts')."\";");
  eval("\$logincode = \"".gettemplate('forumhome_logincode')."\";");
}

add below:
Code:

// ###################### vBaffiliates Stuff #########################

// vBaffiliates stuff

$affillinky = $DB_site->query("SELECT linkid,name,link,b_link,height,width,hits,userid FROM vbaffiliates WHERE moderated='1' ORDER BY RAND() LIMIT $maxbannernumbers");
  while ($affillink=$DB_site->fetch_array($affillinky)) {
         
                  if ($bbuserinfo[userid]==$affillink[userid]) {
                    $editlink = " <a href=\"vbaffiliates.php?s=$session[sessionhash]&action=useredit&linkid=$affillink[linkid]\">Edit</a>";
                  }else{
                    $editlink = "";
                  }
         
                  if ($imginfo=@getimagesize($affillink[b_link])) {
                    if ($imginfo[0]>$affillink[width] or $imginfo[1]>$affillink[height]) {
                            $affiliate = "";
                    }else{
                            eval("\$affiliate .= \"".gettemplate('affiliate')."\";");
                    }
          }
}

:)

Satan

DarkDraco07 01-26-2003 08:26 PM

there was a variable in the header template??


All times are GMT. The time now is 08:11 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.01303 seconds
  • Memory Usage 1,820KB
  • 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
  • (2)bbcode_code_printable
  • (3)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