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)
-   -   vB Affiliates v.2 (https://vborg.vbsupport.ru/showthread.php?t=63044)

GamerJunk.net 04-11-2004 02:18 AM

Woohoo installed! Awesome!

Pitman 04-11-2004 04:01 AM

Quote:

Originally Posted by Pitman
I don't think mine is sending the emails for approval. Does it send the email at a certain time or something? If not mine isn't working right :(

I also modified it a little, and I noticed that the rating system doesn't work now... the link to the site is http://www.game-dog.com/forums/link.php?do=listlinks if anyone can help.

AN-net 04-11-2004 04:11 AM

what did you change?

Pitman 04-11-2004 04:39 AM

Quote:

Originally Posted by AN-net
what did you change?

Well, mostly I added the same features and functions that are in the listlinks to the toplinks.

Pitman 04-11-2004 04:41 AM

It would also be great if you could add a search feature for it, like the member list is mostly, with A-Z and it searches for links that begin with that. Also a search feature for each catagory, maybe as another module. Along with text searches, again possibly as a module.

Edit: I forgot to mention that I converted it to be a links system instead of an affiliate hack

Pitman 04-11-2004 05:01 AM

Contents of link_listbits:
HTML Code:

<tr>
<td class="alt1" align="$stylevar[left]"><if condition="$show[button]"><if condition="$valid"><a href="link.php?do=redirect&u=$link[siteurl]&a=$link[link_id]"><img src="$link[buttonurl]" border="0" /></a><br /><else /><a href="link.php?do=redirect&u=$link[siteurl]&a=$link[link_id]"><img src="$stylevar[imgdir_editor]/unlink.gif" alt="Button N/A" border="0" /><a/><br /></if></if>
<a href="link.php?do=redirect&u=$link[siteurl]&a=$link[link_id]"><i><b>$link[sitename]</b></i></a><if condition="$show['disclaimer']">*</if><if condition="$show[report]"><a href="link.php?do=report&a=$link[link_id]" title="Report a broken url/link." target="_self"><img src="$stylevar[imgdir_button]/report.gif" border="0" /></a></if><br />
<dfn>$link[desc]</dfn></td>
<td class="alt2" align="center">$link[name]</td>
<td class="alt1" align="center">$link[clicksin]</td>
<td class="alt2" align="center">$link[clicksout]</td>
<td class="alt1" align="center"><img src="$stylevar[imagesfolder]/rating/rating_$rating.gif" /><br /><div class="smallfont"><dfn>Total Votes: $link[totalvotes]</dfn></div></td>
<if condition="$show['rate']">
<td class="alt2" align="center"><form action="link.php?do=vote" method="post">
<input type="hidden" name="a" value="$link[link_id]"><select name="rating"><optgroup label="ratings">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</optgroup>
</select>
<input type="submit" value="Rate" class="button">
</form>
</td>
</if>
</tr>


AN-net 04-11-2004 05:12 AM

problem solved. if anyone is experiencing any kind of problems with the voting/rating feature. find this line in your affiliate.php:
PHP Code:

if(empty($a) OR empty($rating)){ 

replace it with this:
PHP Code:

if(empty($_POST['a']) OR empty($_POST['rating'])){ 


Pitman 04-11-2004 05:15 AM

Quote:

Originally Posted by AN-net
problem solved. if anyone is experiencing any kind of problems with the voting/rating feature. find this line in your affiliate.php:
PHP Code:

if(empty($a) OR empty($rating)){ 

replace it with this:
PHP Code:

if(empty($_POST['a']) OR empty($_POST['rating'])){ 


Thanks man... that works perfectly :)

Bryan Ex 04-13-2004 02:50 AM

Installed without problems... thanks very much for your time and effort on this AN-net.

One suggestion and one question - I have mine set to require approval of new links and I finding I'm digging through multiple pages in admincp just to check for new pending submissions. What would be very helpful is a separate "awaiting approval" list so I know right away if there's anything new. I was also wondering about the "active status" as it seems to default to no on all new submissions. Does this change automatically the first time the link is used? If not, where can I change them to default to active: yes so I don't have to edit each one after approving them.

If I'm missing a better way of doing things please let me know.

Thanks very much.

AN-net 04-13-2004 03:44 AM

do you mean the active status or the approval status?

thank you for the suggestion, i might consider that for as an addon to this hack(since i dont plan on releasing a new version for awhile).

Bryan Ex 04-13-2004 05:31 AM

Quote:

Originally Posted by AN-net
do you mean the active status or the approval status?

Active status is what I want to default to YES. Right now I need to approve a new link and then go back and further edit it to "active" to appear on my list.

Bryan Ex 04-13-2004 06:58 AM

As far as the links awaiting approval go... if the query calling up the list of affiliates in the admincp (manage affiliates) was reversed so newest was shown first instead of last it would place anything needing attention on the first page instead of buried several pages back. I just haven't found the right query to make the change yet...

Majik? 04-13-2004 08:37 PM

I changed the sort order to display the sites awaiting approval first, then the sites that are approved but inactive, then the sites that are approved and active.

Bryan Ex 04-13-2004 08:41 PM

Exactly what I'm after... care to share where that query is?

Majik? 04-13-2004 08:42 PM

Quote:

Originally Posted by Bryan Ex
Exactly what I'm after... care to share where that query is?

PHP Code:

$faffiliate$DB_site->query("SELECT affiliate_id,sitename,siteurl,active,approved,email FROM " TABLE_PREFIX "affiliates ORDER BY approved, active, sitename LIMIT $limitvalue,$perpage"); 

I don't remember offhand hat the original line looked like, but just search for $faffiliate= $DB_site->query as I only found that once in the file. ;)

Bryan Ex 04-14-2004 12:09 AM

Exactly what I needed. Much appreciated Majik.

AN-net 04-14-2004 12:27 AM

Quote:

Originally Posted by Majik?
PHP Code:

$faffiliate$DB_site->query("SELECT affiliate_id,sitename,siteurl,active,approved,email FROM " TABLE_PREFIX "affiliates ORDER BY approved, active, sitename LIMIT $limitvalue,$perpage"); 

I don't remember offhand hat the original line looked like, but just search for $faffiliate= $DB_site->query as I only found that once in the file. ;)

thanks:), you saved me alot of work;)

Bryan Ex 04-14-2004 01:31 AM

Last small item for me to sort out... it seems that if the site description text gets too close to the edge of a cell on the affiliate list page I lose the left side border for that cell. Cells affected will change as window size or screen resolution is changed depending on where the text wraps. Any ideas of how to address this?

Bryan Ex 04-16-2004 03:56 PM

Can anyone offer any suggestions on what else I might try because I'm baffled by this one. I've played with cell padding and font sizes to no avail and the left boders continue to disappear where ever text comes within a certain margin width. I just dunno... :disappointed:

AN-net 04-16-2004 06:55 PM

well each cell doesnt have a border, the border you see is the background of the table:) try increasing cellpadding and cellspacing:)

Bryan Ex 04-16-2004 11:19 PM

Got it. I deleted the <dfn> tags around the description text and all is well in the world. :squareeyed:

Bryan Ex 04-18-2004 05:39 PM

Anyway of resetting the stats on a weekly basis or am I looking at digging into the database for that?

AN-net 04-18-2004 09:49 PM

you mean resetting the clicks in and out?

Bryan Ex 04-18-2004 11:49 PM

Exactly. Even with a reasonable delay on clicks - people will cheat so it's nice to either give others a fair chance at being listed or keep the cheaters very busy.

AN-net 04-19-2004 12:20 AM

hmm ill see if i have time to write up a cron script

Bryan Ex 04-19-2004 12:36 AM

That would be great if you have time. Didn't mean to make work for you ... just looking for the easiest way to maintain my affiliate list now that it's installed and running well.

djohn 04-21-2004 11:20 AM

Before I install this, does this hack have a master on-off switch, that would make the affiliates section completely unavailable\available for users?

Bryan Ex 04-21-2004 06:06 PM

Yes it does and you can also grant access to only certain usergroups - like mods for example

SQL question... how can I get the following query to list ORDER BY totalratings / totalvotes ?

Code:

$mvotes= $DB_site->query_first("SELECT sitename,buttonurl,affiliate_id,siteurl,totalvotes FROM affiliates WHERE active='1' AND approved='1' ORDER BY totalvotes DESC");
I'm looking to list affiliates based on average ratings instead of totals but "calcrating" isn't entered into the db.

AN-net 04-21-2004 09:20 PM

Code:

$mvotes= $DB_site->query_first("SELECT sitename,buttonurl,affiliate_id,siteurl,totalvotes FROM affiliates WHERE active='1' AND approved='1' ORDER BY totalvotes DESC");
change that to this:

PHP Code:

$mvotes$DB_site->query_first("SELECT sitename,buttonurl,affiliate_id,siteurl,totalvotes FROM affiliates WHERE active='1' AND approved='1' ORDER BY totalvotes DESC,totalrating DESC"); 


reply back on how that works;)

Bryan Ex 04-21-2004 10:02 PM

It still orders them by totalrating which isn't necesarily correct. I have a "two star" affiliate listed before a "four star" one because of extra votes for a higher total. I think there needs to be some sort of division equasion - SORT BY (totalrating / totalvotes) DESC - for example to list by average.

CarolinaKid 04-27-2004 12:37 AM

ok just got around to upgrading install went flawless so i thought. added a affilate it shows up in admin pannel but does nto show up on site. Yes I did activate it any ideas

AN-net 04-28-2004 07:45 PM

did you approve it?

Lurk 04-30-2004 02:56 AM

I failed to install this :(
the sql queries failed..
I run:
vBulletin 3.0.1
uCash & uShop
vBadvanced

AN-net 04-30-2004 08:37 PM

can you give me the error mysql gave u?

Lurk 04-30-2004 11:28 PM

nvm, i tried the queries again in phpmyadmin and everything worked fine.. :)
thank you for this wonderful hack
[high]* Lurk clicks install[/high]

SM0k3 05-02-2004 03:05 AM

When I run this MySQL query:

PHP Code:

INSERT INTO phrase (languageid,varname,text,phrasetypeidVALUES ('-1''saved_affiliate_x_successfully''<i>{1}\'s</i> has been updates!''9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeidVALUES ('-1''deleted_affiliate_x_successfully''<i>{1}</i> has been deleted!''9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeidVALUES ('-1''deleted_affiliate_x_unsuccessfully''<i>{1}</i> was not deleted due to your choice selection.''9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeidVALUES ('-1''inserted_affiliate_x_successfully''<i>{1}</i> has been successfully added to the data base.''9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeidVALUES ('-1''inserted_affiliate_x_unsuccessfully''This affiliates could not be added to the database because you either did not enter an affiliate name or an affiliate url or an affiliate email.''9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeidVALUES ('-1''saved_affiliate_settings_successfully''Settings for Affiliates Addon Updated.''9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeidVALUES ('-1''updated_affiliate_type_successfully''<i>{1}</i> was updated successfully.''9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeidVALUES ('-1''updated_affiliate_type_unsuccessfully''The type was <u>not</u> updated because the types name was left blank.''9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeidVALUES ('-1''saved_affiliate_type_unsuccessfully''This type/category was not added to the database due to the name of this type/category not being filled in.''9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeidVALUES ('-1''saved_affiliate_type_successfully''<i>{1}</i> was added to the database successfully.''9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeidVALUES ('0''approved_affiliate_x_successfully''<i>{1}</i> has been approved successfully and an email has been dispatched to its admin\'s email.''9000'); 


I get this:

Code:

SQL-query :

INSERT INTO phrase( languageid, varname, text, phrasetypeid )
VALUES (
'-1', 'saved_affiliate_x_successfully', '<i>{1}\'s</i> has been updates!', '9000'
)

MySQL said:

Table 'sm0k3_com.phrase' doesn't exist


in my database i see "vb3_phrase" ...do i need to change the "INSERT INTO phrase" to "INSERT INTO vb3_phrase"?

SM0k3 05-02-2004 03:15 AM

nevermind.....i went ahead and took a chance and it worked...thanks anyways :)

Skyline_GT 05-02-2004 04:49 AM

I got this erro when I am trying to add affiliate_list template

Code:

The following error occurred when attempting to evaluate this template:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/gamerzpl/public_html/forums/includes/adminfunctions_template.php(3037) : eval()'d code on line 97

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.


AN-net 05-02-2004 03:32 PM

could u please post the code your inserting into that template?

Skyline_GT 05-02-2004 05:54 PM

The Code that I put for that template is
Code:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
        <title>$vboptions[bbtitle] - vB Affilates: List</title>
$headinclude
</head>
<body>
$header
$navbar
<br />
<table width="100%" align="center">
<tr>
<if condition="$show['sides']">
<if condition="$show[leftside]">
<td valign="top" align="center" width="150">
$momentbits
$mhobits
$mhibits
$mvbits
</td>
</if>
</if>
<td>
<if condition="$setting[top]">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tbody>
<tr class="tcat">
<td colspan="4" align="center">        <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('toplist')"><img id="collapseimg_toplist" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_toplist].gif" alt="" border="0"></a><font size="3"><b>Top(<i>$setting[top_limit]</i>) Affiliates</b></font></td>
</tr>
</tbody>
<tbody id="collapseobj_toplist" style="$vbcollapse[collapsetobj_toplist]">
<tr>
<td class="thead" align="center">#</td>
<td class="thead" width="100%" align="$stylevar[left]">Name</td>
<td class="thead" align="center">Hits Out</td>
<td class="thead" align="center">Hits In</td>
</tr>
$topbits
</tbody>
</table>
<br />
</if>
<form action="affiliate.php?do=listaffiliates" method="post">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tbody>
<tr>
<td colspan="2" class="thead" align="center"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('displayopt')"><img id="collapseimg_displayopt" src="$stylevar[imgdir_button]/collapse_alt$vbcollapse[collapseimg_displayopt].gif" alt="" border="0"></a>Display Options</td>
</tr>
</tbody>
<tbody id="collapseobj_displayopt" style="$vbcollapse[collapsetobj_displayopt]">
<tr>
<td class="alt1">Order By:<select name="by">
<optgroup label="Order By:">
<option value="sitename">Name</option>
<option value="name">Category/Type</option>
<option value="clicksout">Hits Out</option>
<option value="clicksin">Hits In</option>
<option value="totalvotes">Total Votes</option>
</optgroup>
</select>
</td>
<td class="alt2">Sort Order:
<select name="in">
<optgroup label="Sort Order:">
<option value="DESC">Descending</option>
<option value="ASC">Ascending</option>
</optgroup>
</select>
</td>
</tr>
<tr>
<td colspan="2" class="tcat" align="center"><input type="submit" value="Show Affiliates" class="button" /></td>
</tr>
</tbody>
</table>
</form>
<br />
<if condition="$show[pagination]">
<table align="center" width="100%" class="tborder"><tr><td class="tcat"><if condition="$show[prevactive]"><a href="affiliate.php?do=listaffiliates&page=$pageprev">促rev</a><else />促rev</if></td><td class="tcat" align="right"><if condition="$show[nextactive]"><a href="affiliate.php?do=listaffiliates&page=$pagenext">Next?/a><else />Next?/if></td>
</tr>
</table>
<br />
</if>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tbody>
<tr class="tcat">
<td colspan="6" align="center"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('afflist')"><img id="collapseimg_afflist" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_afflist].gif" alt="" border="0"></a><b><font size="5">$vboptions[bbtitle]'s Affiliates</font></b></td>
</tr>
</tbody>
<tbody id="collapseobj_afflist" style="$vbcollapse[collapsetobj_afflist]">
<tr>
<td class="thead" align="$stylevar[left]">Name/Description</td>
<td class="thead" align="center">Type/Category</td>
<td class="thead" align="center">Hits In</td>
<td class="thead" align="center">Hits Out</td>
<td class="thead" align="center">Rating</td>
<if condition="$show['rate']">
<td class="thead" align="center">Rate</td>
</if>
</tr>
$affiliatebits
</tbody>
<tr class="tcat">
<td align="center" colspan="6"><b>:<a href="affiliate.php">Index</a>:<if condition="$show['apply']">-:<a href="affiliate.php?do=apply">Apply for Affiliation</a>:</if></b></td>
</tr>
</table>
<br />
<if condition="$show['disclaimer']">
<div class="smallfont">*$vboptions[bbtitle]'s affiliates do not represent or express $vboptions[bbtitle]'s opinions,views, or ideals.</div></if>
</td>
<if condition="$show['sides']">
<if condition="$show[rightside]">
<td valign="top" align="center" width="150">
$momentbits
$mhobits
$mhibits
$mvbits
</td>
</if>
</if>
</tr>
</table>
<br />
$crn
<br />
$footer
</body>
</html>

and for line 3037 on adminfunctions_template.php

Code:

eval('$devnull = "' . $template . '";');


All times are GMT. The time now is 01:39 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.02083 seconds
  • Memory Usage 1,892KB
  • 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
  • (6)bbcode_code_printable
  • (1)bbcode_html_printable
  • (8)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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