PDA

View Full Version : [Image-Based Rating System] Mod


VSDan
09-25-2005, 08:02 PM
Not sure if this has been done, but this quick mod will allow you display rating images. For example, 10 stars if rated 10 and 1 star if rated 1.

Content visible to registered users only.

Note: change URL to images if the location differs on your server.

Sample images attached as stars.zip
(feel free to download for your use - you can easily change the colours using an application like PainShop or PhotoShop, to name a few)


Cheers.

Dan
Virtual Solutions
monster-submit.com

yktan
09-26-2005, 04:32 AM
Thank for sharing VSDan! :)

Serge
10-20-2005, 12:47 AM
Content visible to registered users only.

I hope my code will work fine too :D

Content visible to registered users only.

VSDan
10-20-2005, 04:34 AM
Content visible to registered users only.

I hope my code will work fine too :D

Content visible to registered users only.[/quote]

Would not work in cases where rating was not a whole number or decimal as .5 - for example, 5.4 would equal 10.8. You need to round off to nearest whole number (round($link.RATE * 2)), which I believe requires {php}{/php} - something I was trying to avoid at the time.

LinkReal
01-07-2006, 07:56 PM
VSDan- nice work
Sorry for being a newbie @ this but where would one put your code for it to work.

Thanks in advance.

VSDan
01-07-2006, 09:52 PM
Sorry about that, in the link.tpl template file =)

LinkReal
01-08-2006, 05:18 PM
Content visible to registered users only.

Just drop the code anywhere?

thanks in advance.

VSDan
01-08-2006, 06:01 PM
Pretty much, anywhere you want the images to display. Play around with it until you get it right.

LinkReal
01-09-2006, 05:42 AM
thanks much...
guess i wont know if it works until i fully launch the site and start to get some traffic.

Thanks for all the help and nice mods VSDan

VSDan
01-09-2006, 06:36 AM
Thanks, and you're welcome =)

gustotelmy
01-11-2006, 09:26 PM
You are the best! thanks buddy for sharing,
all the best to you for the new year.
:D

VSDan
01-11-2006, 09:31 PM
Thanks, and the same back at ya!

John D
01-11-2006, 10:34 PM
Is this for if the rating mod is installed?

VSDan
01-11-2006, 11:04 PM
Yes, you need to have the Rating mod installed.

swapshop
01-13-2006, 08:59 AM
Where is the rating mod?

VSDan
01-13-2006, 09:43 AM
Here you go:

Rating and Comments Mod (http://www.phplinkdirectory.com/articlescript/Rate_Listing_phpLD_Vault_Mod.php)

leefs
06-02-2006, 03:28 AM
Link is broken. Where can I find the rate mod?

Domie
06-14-2006, 02:37 PM
How do you install this mod?

vignesh_natraj
06-23-2006, 03:24 PM
i used this code so the image does not link to the site
Content visible to registered users only.

KartKorner
06-24-2006, 10:55 PM
Where can I obtain the Rate Link System for 3.0.5? Thanks.

Optimit
06-25-2006, 03:07 AM
Get it from VsDan's website. If you look at many of the mods in the complete mod list, you will see how to get to his list of mods.

KartKorner
06-25-2006, 03:18 AM
Thanks Opt. just stopped by and picked it up :) Now time to learn something new....heh

2bet
10-08-2006, 12:18 AM
ok, i have the rate mod installed, which works, but when i try and add this image mod, I just show the Content visible to registered users only. under each listing. I have uploaded the images in the root of the directory, so the image location is correct, just can't seem to get the script to pull and show them. Here is my link.tpl code incase i have something wrong:

Content visible to registered users only.



im using version the most recent copy of version 2 for this directory, www.69blogs.com/submit (http://www.69blogs.com/submit) <--- mainly adult listings, so i want to warn everyone before opening this directory.

potyka
10-08-2006, 03:53 PM
Hy!

Somebody gives back is aware of base mod installing? What where does he fit?

2bet
10-08-2006, 05:31 PM
Content visible to registered users only.
bump for help

potyka
10-08-2006, 06:09 PM
Image Based Rating System Mod (http://www.phplinkdirectory.com/forum/showthread.php?t=790)
This I thought so.tuck in does not operate the link.tpl and..does he stand?do you rewrite something?

potyka
10-08-2006, 06:40 PM
{if $link.RATE eq '10.00'}Content visible to registered users only.
{elseif $link.RATE eq '0.00'}Content visible to registered users only.
{elseif $link.RATE eq ''}Content visible to registered users only.
{elseif $link.RATE le '0.50'}Content visible to registered users only.
{elseif $link.RATE le '1.00'}Content visible to registered users only.
{elseif $link.RATE le '1.50'}Content visible to registered users only.
{elseif $link.RATE le '2.00'}Content visible to registered users only.
{elseif $link.RATE le '2.50'}Content visible to registered users only.
{elseif $link.RATE le '3.00'}Content visible to registered users only.
{elseif $link.RATE le '3.50'}Content visible to registered users only.
{elseif $link.RATE le '4.00'}Content visible to registered users only.
{elseif $link.RATE le '4.50'}Content visible to registered users only.
{elseif $link.RATE le '5.00'}Content visible to registered users only.
{elseif $link.RATE le '5.50'}Content visible to registered users only.
{elseif $link.RATE le '6.00'}Content visible to registered users only.
{elseif $link.RATE le '6.50'}Content visible to registered users only.
{elseif $link.RATE le '7.00'}Content visible to registered users only.
{elseif $link.RATE le '7.50'}Content visible to registered users only.
{elseif $link.RATE le '8.00'}Content visible to registered users only.
{elseif $link.RATE le '8.50'}Content visible to registered users only.
{elseif $link.RATE le '9.00'}Content visible to registered users only.
{elseif $link.RATE le '9.50'}Content visible to registered users only.
{else}Content visible to registered users only.
{/if}


In the link.tpl does not team I tucked this code- but kéne does not operate what I to do so that does he operate?

2bet
10-08-2006, 10:39 PM
Content visible to registered users only.

ok, bumping again for bottom spot

VSDan
10-09-2006, 05:58 AM
Hi:

You need to change image URLs. For example:

change:
Content visible to registered users only.

to:
Content visible to registered users only.

* change URL to images if it differs on your server

2bet
10-09-2006, 07:27 PM
Content visible to registered users only.

Your assistance is Greatly appreciated... Thank you!!

VSDan
10-09-2006, 07:43 PM
You're welcome =) I've got to fix the original post - the image tags may have been messed up under the old board (phpBB).

potyka
10-09-2006, 10:07 PM
Thx!!!
Every ok! already only the link vote ought to start.

His here code I tuck in what the link.tpl in ...

<tr><td colspan="2"><p style="clear: both;"><a id="" href=""></a> <span class="url"></span></p><p></p><p></p></td></tr><tr><td class="label"><span class="req">*</span>Rating:</td><td class="field"><select name="NEW_RATE"><option label="1" value="1" selected="selected">1</option><option label="2" value="2">2</option><option label="3" value="3">3</option><option label="4" value="4">4</option><option label="5" value="5">5</option><option label="6" value="6">6</option><option label="7" value="7">7</option><option label="8" value="8">8</option><option label="9" value="9">9</option><option label="10" value="10">10</option></select>
</td></tr><tr><td colspan="2" class="buttons"><input name="submit" value="Link &eacute;rt&eacute;kel&eacute;se" class="btn" type="submit"></td></tr>
</p>


Is the problem?

VSDan
10-09-2006, 10:24 PM
To use in link.tpl:

1. Wrap in FORM tags
Content visible to registered users only.

2. Add the following also between the FORM tags:

Content visible to registered users only.

potyka
10-11-2006, 02:56 PM
This now error I have I fixed all message! :(
Notice: SmartyValidate: [validate plugin] form 'rate_link_form' is not registered. in /var/www/virtual/xxxx/htdocs/libs/smarty/plugins/function.validate.php on line 49

VSDan
10-11-2006, 09:41 PM
Hi:

Can you post URL where I can see it action, so I can replicate the error. Thanks.

VSDan
10-12-2006, 05:57 AM
Looks like you are using someone else's rating mod. Can you post your rate.php.

VSDan
10-12-2006, 05:59 PM
Complicated. Simplest solution is to edit rate.php by changing:

Content visible to registered users only.

to:

Content visible to registered users only.

No longer any IP checking to prevent multiple rating from same person. You can edit IP checking to revised code.

potyka
10-12-2006, 06:30 PM
Parse error: parse error, unexpected $ in /var/www/virtual/xxx.hu/htdocs/rate.php on line 94


The code operates did not dare I may spoil something the editing ..If you send does he not capture do I request you editorially?

potyka
10-14-2006, 03:53 PM
please help my!

VSDan
10-14-2006, 07:56 PM
You edited rate.php incorrectly. I need to see your revised rate.php.

ping
10-14-2006, 11:14 PM
Any hope of having this mod use ajax ?

VSDan
10-14-2006, 11:22 PM
Content visible to registered users only.

In the next version. Not sure when that will be, as in the planning stages for new mod to be coded and released in the next week.

potyka
10-16-2006, 07:22 PM
I am not aware of I am not aware of to realize the bug so that I compile the code!And may make rating also maximum 1 star...

VSDan
10-16-2006, 07:51 PM
Content visible to registered users only.

We have a language issue here, and I do not understand your problem. Can you provide URL to where I can see it in action? Thanks.

potyka
10-17-2006, 07:42 PM
Content visible to registered users only.

<div style="padding:5px;">
<table{if $link.FEATURED} class="featured"{/if} width="100%">
<tr>
<td width="170">
<a id="id_{$link.ID}" href="{$link.URL|escape}" title="{$link.TITLE|escape}"
{* nofollow *}
{if $link.NOFOLLOW or ($link.RECPR_VALID eq 0 and ($smarty.const.RECPR_NOFOLLOW eq 2 or ($smarty.const.RECPR_NOFOLLOW eq 1 and $link.RECPR_REQUIRED eq 1)))} rel="nofollow"{/if}
{if $smarty.const.ENABLE_BLANK} target="_blank"{/if}>
<img style="border: 4px double #008f00;" alt="{$link.TITLE|escape|trim}" width="160" height="120" src="http://msnsearch.srv.girafa.com/srv/i?s=MSNSEARCH&amp;r={$link.URL|escape|trim}" />
</a>
</td>
<td>
<a id="id{$link.ID}" href="{$link.URL|escape}" title="{$link.TITLE|escape}"
{* nofollow *}
{if $link.NOFOLLOW or ($link.RECPR_VALID eq 0 and ($smarty.const.RECPR_NOFOLLOW eq 2 or ($smarty.const.RECPR_NOFOLLOW eq 1 and $link.RECPR_REQUIRED eq 1)))} rel="nofollow"{/if}
{if $smarty.const.ENABLE_BLANK} target="_blank"{/if}>
{$link.TITLE|escape}</a>
<span class="url">- {$link.URL|escape|trim}</span>
<p>
{$link.DESCRIPTION|escape|trim}
<br />
[<a href="{if !$smarty.const.ENABLE_REWRITE}
{$smarty.const.DOC_ROOT}/detail.php?id={$link.ID}
{else}
{$smarty.const.DOC_ROOT}/detail/link-{$link.ID}.html{/if}" title="{l}Read more about{/l}: {$link.TITLE|escape|trim}">{l}Tov&aacute;bbi inform&aacute;ci&oacute;{/l}
</a>]
{if $smarty.const.REQUIRE_REGISTERED_USER == 1 && !empty ($regular_user_details) && ($regular_user_details.ID == $link.OWNER_ID)}
[<a href="{$smarty.const.DOC_ROOT}/submit.php?linkid={$link.ID}" title="{l}Edit or Remove your link{/l}">{l}Review{/l}</a>]
{/if}
{if $link.RATE eq '10.00'}<img src="/images/20.gif" border="0">
{elseif $link.RATE eq '0.00'}<img src="/images/0.gif" border="0">
{elseif $link.RATE eq ''}<img src="/images/0.gif" border="0">
{elseif $link.RATE le '0.50'}<img src="/images/1.gif" border="0">
{elseif $link.RATE le '1.00'}<img src="/images/2.gif" border="0">
{elseif $link.RATE le '1.50'}<img src="/images/3.gif" border="0">
{elseif $link.RATE le '2.00'}<img src="/images/4.gif" border="0">
{elseif $link.RATE le '2.50'}<img src="/images/5.gif" border="0">
{elseif $link.RATE le '3.00'}<img src="/images/6.gif" border="0">
{elseif $link.RATE le '3.50'}<img src="/images/7.gif" border="0">
{elseif $link.RATE le '4.00'}<img src="/images/8.gif" border="0">
{elseif $link.RATE le '4.50'}<img src="/images/9.gif" border="0">
{elseif $link.RATE le '5.00'}<img src="/images/10.gif" border="0">
{elseif $link.RATE le '5.50'}<img src="/images/11.gif" border="0">
{elseif $link.RATE le '6.00'}<img src="/images/12.gif" border="0">
{elseif $link.RATE le '6.50'}<img src="/images/13.gif" border="0">
{elseif $link.RATE le '7.00'}<img src="/images/14.gif" border="0">
{elseif $link.RATE le '7.50'}<img src="/images/15.gif" border="0">
{elseif $link.RATE le '8.00'}<img src="/images/16.gif" border="0">
{elseif $link.RATE le '8.50'}<img src="/images/17.gif" border="0">
{elseif $link.RATE le '9.00'}<img src="/images/18.gif" border="0">
{elseif $link.RATE le '9.50'}<img src="/images/19.gif" border="0">
{else}<img src="/images/20.gif" border="0"
{/if}{* show page rank *}
{if $smarty.const.SHOW_PAGERANK}

<td width="40">
{include file="pagerank.tpl" pr=$link.PAGERANK}
{/if}
<table width="185" height="73" cellpadding="2" cellspacing="2">
<tr>
<form action="rate.php" method="POST"><td><tr><td colspan="2"><p style="clear: both;"><a id="" href=""></a> <span class="url"></span></p><p></p><p></p></td></tr><tr>
<td class="label">Szavazz</td>
<td class="field"><select name="NEW_RATE"><option label="1" value="1" selected="selected">1</option><option label="2" value="2">2</option><option label="3" value="3">3</option><option label="4" value="4">4</option><option label="5" value="5">5</option><option label="6" value="6">6</option><option label="7" value="7">7</option><option label="8" value="8">8</option><option label="9" value="9">9</option><option label="10" value="10">10</option></select>
</td></tr><tr><td colspan="2" class="buttons"><input name="submit" value="Link &eacute;rt&eacute;kel&eacute;se" class="btn" type="submit"><input type="hidden" name="id" value="{$link.ID}"></form></td></tr>
</p></td>
</tr>
</table>
<p> {if $link.RATE_ENABLED eq 1}<BR>
{/if}</p>
</table>
Tal&aacute;lat:{$link.HITS} &Eacute;rt&eacute;kel&eacute;s: {$link.RATE}Szavazatok: {$link.RATE_COUNT}
<hr />
</div>

VSDan
10-17-2006, 07:49 PM
No obvious problems there. How about seeing your rate.php.

potyka
10-18-2006, 06:16 AM
De I did not mean variation's veracity bemásoltam you wrote what but non well.. The dotting does not want = class and the greater at that time does not give vainly I poll to operate several point.

potyka
10-18-2006, 08:08 PM
What intelligible did I write?

VSDan
10-18-2006, 08:15 PM
Content visible to registered users only.

Sorry, but I still do not understand what you are saying. Me thinks that you may be using an online translation service. Either way, do you know someone who is fluent in your native language AND English, that can translate what you are trying to say? Perhaps somone in this forum?

potyka
10-18-2006, 08:22 PM
ought I get what I to repair the rate.php how the bug message?

VSDan
10-18-2006, 08:59 PM
Can you post your rate.php file. I need to see it.

potyka
10-19-2006, 06:23 AM
Hi! I shipped private message ....

Thx

euwebdirectory
02-10-2007, 07:04 PM
I every body.
i have a problem with this mod, when i want to send "rate" to directory it show a message:

"Fatal error: Call to undefined function: datetimedifference() in /web/htdocs/www.xxxxxxxxxxx.net/home/directorio/rate.php on line 188"

Help please

VSDan
02-10-2007, 07:55 PM
Fixed. I've updated the mod in the phpLD_Vault - just need to replace rate.php. Thanks for the heads up!