Log in

View Full Version : Portal Software - [Chris] Rate My Photo (HorOrNot Clone)


Christos Teriakis
10-26-2012, 10:00 PM
Rate My Photo (Hot or Not Clone)
by ChrisTERiS

IMPORTANT
This is NOT a Gallery addon. It focuses only to photo rating and not to photo presentation


Please note that from
11 Aug 2013
you can get support only in my site
http://www.teriakis.com (http://www.teriakis.com)



Today is my birthday and as the time that I was celebrating the has passed, I decided to release an addon that I had somewhere in my HD. Is not the "killer" addon, but works fine, and as I know there is no other similar addon available.

1.- Installation

Upload all files from upload folder to the folder where your vBulletin 4.2 is installed
CMOD 777 the directories
ratemyphoto/photos
ratemyphoto/photos/thumbs
Login to your admincp and import the file product-ratemyphoto.xml
Set Usergroup permissions
Set General Options according to your needs
If you want modify PM templates but don't touch anything betwee {}
Set the Categories2.- Requiremenets
Installed and fully operating vBulletin
vBulletin version 4.2
Does NOT works with vBulletin 5 Connect3.- Copyright Link

In all pages there is my copyright link back to my site. Removing it, or making it invisible is strictly prohibited.

4.- PRO version

During the first week of November 2012, I'll release a commercial (PRO) version with more features and without copyright link in a low price.

Enjoy it
Christos Teriakis

ejbreeze
10-27-2012, 08:28 PM
How do you post a photo? The attachment button doesn't work when I click it. Thanks. Nice mod by the way. This is what I see.

https://vborg.vbsupport.ru/external/2012/10/26.png

Christos Teriakis
10-27-2012, 08:49 PM
How do you post a photo? The attachment button doesn't work when I click it. Thanks. Nice mod by the way. This is what I see.


What browser are you using? I've tested with IE, FF and Chrome and works, while in your screenshot the upload field is not visible. Only the description below is visible.

Chris

ejbreeze
10-27-2012, 08:52 PM
I am using chrome. And yes I only see the description. Let me try with IE.

ejbreeze
10-27-2012, 08:55 PM
Same thing with Firefox.

Christos Teriakis
10-28-2012, 06:11 AM
Same thing with Firefox.

The 2nd screenshot in my post taken with FF 16.0.2. With Chrome 22.0 also works fine. I assume that you're not trying to upload photo with a device does not supports uploading (eg iPad).

Chris

ejbreeze
10-28-2012, 01:38 PM
Reverting back to the default style shows the upload box. Using my purchased custom style it won't show. Any ideas? Everything else seems to work good. Thanks.

Christos Teriakis
10-28-2012, 03:37 PM
Reverting back to the default style shows the upload box. Using my purchased custom style it won't show. Any ideas? Everything else seems to work good. Thanks.

In this case, seems that your customized style uses javascript which conflists with the upload box. What I mean. In the upload box there is a javasctipt script which checks the file extension of the file that you're trying to upload in client-side (before send it to server). Most probably this is the issue. To correct it you need to edit the template: ratemyphoto_addedit_photo

Find:

<input type="file" name="logo" id="logo" onblur="return CheckImageExt(this)" size="25">


Replace it with:

<input type="file" name="logo" id="logo" size="25">


On the same template (at the top) you must remove all the code below:

<script type="text/javascript">
function CheckImageExt(fld)
{
if (fld.value != '')
{
var image_ext = getFileExtension(fld.value);
var valid_images = new Array("jpg","jpeg","gif","png","JPG","JPEG","GIF","PNG");
if (valid_images.indexOf(image_ext) > -1)
{
return true;
}
else
{
alert('You can upload only .gif, .jpg, .jpeg, .png files.');
fld.value = '';
fld.select();
fld.focus();
return false;
}
}
else
{
return true;
}
}
</script>
<script type="text/javascript">
function getFileExtension(filename)
{
return filename.split('.').pop();
}
</script>


Christos

ejbreeze
10-28-2012, 03:49 PM
Same results with the changes made. Here is my template.

<script type="text/javascript" src="clientscript/vbulletin-editor.js?v={vb:raw vboptions.simpleversion}"></script>
<link rel="stylesheet" type="text/css" href="{vb:var vbcsspath}editor.css" />
<link rel="stylesheet" type="text/css" href="{vb:var vbcsspath}bbcode.css" />
<script type="text/javascript">
function validateForm_vbform()
{
if(document.forms["vbform"].title.value.length == 0) {
alert('{vb:var vbphrase.ratemyphoto_error_title}');
return false;
}
if(document.forms["vbform"].categoryid != undefined){
if(!isNaN(document.forms["vbform"].categoryid.value) == 0) {
alert('{vb:var vbphrase.ratemyphoto_error_category_number}');
return false;
}else if(document.forms["vbform"].categoryid.value ==0){
alert("{vb:var vbphrase.ratemyphoto_error_category_zero}");
return false;
}
if(document.forms["vbform"].logo.value.length == 0) {
alert('{vb:var vbphrase.ratemyphoto_error_photo}');
return false;
}
}
return true;
}
</script>


<form class="block" action="ratemyphoto_usercp.php" method="post" enctype="multipart/form-data" name="vbform" onsubmit="return vB_Editor['{vb:raw editorid}'].prepare_submit(0, {vb:raw vboptions.postminchars})">
<vb:if condition="$editmode == 0">
<h2 class="blockhead">{vb:var vbphrase.ratemyphoto_addnew_photo}</h2>
<vb:else />
<h2 class="blockhead">{vb:var vbphrase.ratemyphoto_edit_photo} {vb:raw title}</h2>
</vb:if>
<div class="blockbody formcontrols settings_form_border">
<h3 class="blocksubhead">{vb:var vbphrase.ratemyphoto_general_details}</h3>
<div class="section">
<vb:if condition="$editmode == 0">
<div class="blockrow">
<label>{vb:var vbphrase.ratemyphoto_select_photo}</label>
<div class="rightcol">
<input type="file" name="logo" id="logo" size="25">
<p class="description">{vb:var vbphrase.ratemyphoto_h_photo}</p>

</div>
</div>
</vb:if>
<div class="blockrow">
<label>{vb:var vbphrase.ratemyphoto_category}</label>
<div class="rightcol">
{vb:raw selectcategory}
<p class="description">{vb:var vbphrase.ratemyphoto_h_category}</p>
</div>
</div>
<div class="blockrow">
<label>{vb:var vbphrase.ratemyphoto_title}</label>
<div class="rightcol">
<input type="text" name="title" style="width:98%;" value="{vb:raw title}">
<p class="description">{vb:var vbphrase.ratemyphoto_h_title}</p>
</div>
</div>
</div>
<h3 class="blocksubhead">{vb:var vbphrase.ratemyphoto_photo_details}</h3>
<div class="wysiwyg_block">
{vb:raw messagearea}
</div>
<div class="blockfoot actionbuttons settings_form_border">
<div class="group">
<input type="submit" class="button" value="{vb:rawphrase save_changes}" onclick="return validateForm_vbform()" tabindex="1" accesskey="s" />
<input type="reset" class="button" value="{vb:rawphrase reset_fields}" tabindex="1" accesskey="r" />
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="do" value="saveupdatephoto" />
<input type="hidden" name="photoid" value="{vb:raw id}" />
<input type="hidden" name="userid" value="{vb:raw userid}" />
<input type="hidden" name="username" value="{vb:raw username}" />
<input type="hidden" name="urlid" value="{vb:raw urlid}" />
<input type="hidden" name="oldlogo" value="{vb:raw oldlogo}" />
<input type="hidden" name="editmode" value="{vb:raw editmode}" />
</div>
</div>
</div>
</form>
<div class="shade footer_copyright">
Powered by <a target="_blank" href="http://www.christeris.com/">Rate My Photo</a><br />
Copyright &copy; 2012 by <a target="_blank" href="http://www.christeris.com/">ChrisTERiS</a>
</div>

Christos Teriakis
10-28-2012, 04:11 PM
Same results with the changes made. Here is my template.



I was expecting it as my code was a very simple javascript. Nothing special. As it works with the default template, then is a template issue so you need to contact your designer. He knows better what javascript calls has there. As a second thought. Try any other section of your site where there is upload box. Does it works?

Christos

ejbreeze
10-28-2012, 04:12 PM
I found the upload box. It is in the upper left hand corner with only a very small portion of the box showing.

ejbreeze
10-28-2012, 04:18 PM
Here is a screen shot.

142028

Christos Teriakis
10-28-2012, 04:37 PM
Here is a screen shot.

142028

Then for sure you need to contact your designer and ask for support. Its not a coding issue.

Christos

Christos Teriakis
10-28-2012, 04:43 PM
I'm not designer, but you can try this:

<input type="file" name="logo" id="logo" style="position:relative;" size="30">

ejbreeze
10-28-2012, 04:51 PM
That get's it down close but not aligned correctly. What does work if I remove

id="logo"

so it looks like this:

<input type="file" name="logo" size="30">

It seems to function fine now. Do you see any problems keeping it like this? Thanks again and hurry up and come out with your pro version.

Christos Teriakis
10-28-2012, 05:05 PM
That get's it down close but not aligned correctly. What does work if I remove

id="logo"

so it looks like this:

<input type="file" name="logo" size="30">

It seems to function fine now. Do you see any problems keeping it like this? Thanks again and hurry up and come out with your pro version.

As long as you've removed the javascript for checking the file extention, the id can be removed without any problem on usage.

Christos

Christos Teriakis
10-28-2012, 05:15 PM
If you want to use the javascript check, you can give a try by changing id="logo" to id="photo". Most probably there is another id="logo" in the page (eg the site logo).

ejbreeze
10-28-2012, 05:30 PM
That worked changing id="photo" only in the original code. Thanks. I guess my banner logo script was conflicting with your id name. Thanks. Can we purchase now to remove the copyright then get the pro version when it comes out?

Christos Teriakis
10-28-2012, 05:34 PM
That worked changing id="photo" only in the original code. Thanks. I guess my banner logo script was conflicting with your id name. Thanks. Can we purchase now to remove the copyright then get the pro version when it comes out?

You can remove it now and when the PRO version comes out you can pay it at that time.

Christos

ejbreeze
10-28-2012, 08:37 PM
Thanks. Marked installed.

ejbreeze
10-29-2012, 01:25 AM
Will the pro version have clickable image so you can view the full size photos? Example by clicking on the worse rated side bar photo will bring up its full size photo or by clicking on the small thumbnails in Newest Photos for Rating will bring up a full size. Also will it have an option to show best and worse photos in the side bar on forumhome? Thanks.

Christos Teriakis
10-29-2012, 06:59 AM
Will the pro version have clickable image so you can view the full size photos? Example by clicking on the worse rated side bar photo will bring up its full size photo or by clicking on the small thumbnails in Newest Photos for Rating will bring up a full size. Also will it have an option to show best and worse photos in the side bar on forumhome? Thanks.

In a brief, yes to all.

Chris

bhdreren
10-29-2012, 02:33 PM
how approving will be done?? it says always Awaiting Approval

Christos Teriakis
10-29-2012, 03:51 PM
how approving will be done?? it says always Awaiting Approval

If you belong in a usergroup with permissions to Moderate, you'll see a menu "Moderate" with a submenu "Approve Photos".
Have you set the permissions per usergroup for Rate My Photo?

Chris

socialteenz
10-30-2012, 01:47 PM
How about a widget in forum home?? I mean in the side bar!!

I am gonna install this once my new board is up.

Christos Teriakis
10-30-2012, 04:30 PM
How about a widget in forum home?? I mean in the side bar!!

I am gonna install this once my new board is up.

If you want a specific one, tell me what exactly do you want to show, and I'll give you the code to build it. I don't use to build predefinied widgets/blocks, but rather I'm including my own block generator which can produce many types of them according to your needs, and furthure more to auto install them in your system.

Chris

socialteenz
10-30-2012, 06:04 PM
If you want a specific one, tell me what exactly do you want to show, and I'll give you the code to build it. I don't use to build predefinied widgets/blocks, but rather I'm including my own block generator which can produce many types of them according to your needs, and furthure more to auto install them in your system.

Chris

When ever some one upload their photo for rating, it should appear on the side block.

Others should able to rate the photo (If they haven't rated it already). Else, the rating for the photo should be shown.

Thanks.

Christos Teriakis
10-30-2012, 06:17 PM
When ever some one upload their photo for rating, it should appear on the side block.

Others should able to rate the photo (If they haven't rated it already). Else, the rating for the photo should be shown.

Thanks.

In simple words you mean to show the latest photo. I can do it and release the code here but I'll go one step ahead. By showing the latest photo with its rating (if user has already rated it), has no so much meaning. So I'll show the latest UNRATED by the user photo, and only if there is no one (in case that user has rated all photos), then I'll show the latest photo with the rating.

Chris

socialteenz
10-30-2012, 08:00 PM
In simple words you mean to show the latest photo. I can do it and release the code here but I'll go one step ahead. By showing the latest photo with its rating (if user has already rated it), has no so much meaning. So I'll show the latest UNRATED by the user photo, and only if there is no one (in case that user has rated all photos), then I'll show the latest photo with the rating.

Chris

Perfect :)

ejbreeze
11-03-2012, 10:22 PM
Chris I installed this on my production site and when I click on categories in the admin control area to create categories I get this error,

500 - Malformed Header

The server encountered an internal error or misconfiguration and was unable to complete your request.

I have check permissions and compared them to my test site where it is working and everything is the same. Any ideas?

Christos Teriakis
11-04-2012, 02:31 PM
Chris I installed this on my production site and when I click on categories in the admin control area to create categories I get this error,

500 - Malformed Header

The server encountered an internal error or misconfiguration and was unable to complete your request.

I have check permissions and compared them to my test site where it is working and everything is the same. Any ideas?

Your test and your active installation are resist on the same server?

Chris

CoZmicShReddeR
11-04-2012, 02:35 PM
I remember using something like this way back when with my phpnuke website... Took me forever to understand where the images are uploaded... I think it probably would be better to have the upload image located on the page someone instead of trying to fish for it through the member settings area... As it is the members setting area on my website is way to overloaded and really a pain in the ass to find anything... Maybe you could build something to customize that area with color coding or a hot or not icon??

ejbreeze
11-04-2012, 02:51 PM
Your test and your active installation are resist on the same server?

Chris

Yes they are.

Christos Teriakis
11-04-2012, 06:42 PM
Yes they are.

That's totally strange. In any case, just 2 solutions to try:

1.- From ratemyphoto_admin.php remove the code (at the top):

if(@fopen(DIR . '/includes/adminfunctions_cms.php', 'r')==TRUE)
{
require_once(DIR . '/includes/adminfunctions_cms.php');
require_once(DIR . '/includes/functions_cms_layout.php');
$cms_exists = 1;
}


2.- Have you cmod 777 the directories "photos" etc.

Chris

Christos Teriakis
11-04-2012, 06:45 PM
I remember using something like this way back when with my phpnuke website... Took me forever to understand where the images are uploaded... I think it probably would be better to have the upload image located on the page someone instead of trying to fish for it through the member settings area... As it is the members setting area on my website is way to overloaded and really a pain in the ass to find anything... Maybe you could build something to customize that area with color coding or a hot or not icon??

1.- The uploaded images are storing at ratemyphotos/photos/ directory.
2.- I was the only one who never added links at usercp, but 90% of users here want the links there. In anycase, there are also links at the frontend (ratemyphoto.php) file.

Chris

ejbreeze
11-04-2012, 07:14 PM
Thanks Chris. When I went to edit that file I saw it was out of order and wouldn't let me overwrite it. So I deleted it and uploaded the original file again. Seems to be working now.

Christos Teriakis
11-04-2012, 07:32 PM
Thanks Chris. When I went to edit that file I saw it was out of order and wouldn't let me overwrite it. So I deleted it and uploaded the original file again. Seems to be working now.

That's why you got this server error. For some reason the file during upload cmod to 600 instead of 644 which is the normal.

Chris

Live_Bait
11-09-2012, 10:03 AM
Hi, is there any way to add a Gif and let there be animation? I added one and works just no animation. Thanks Love this mod.. waiting for the paid release...

Christos Teriakis
11-09-2012, 06:30 PM
Hi, is there any way to add a Gif and let there be animation? I added one and works just no animation. Thanks Love this mod.. waiting for the paid release...

Hi,

Can you tell me the actual dimensions of the gif image that you're trying to upload and the settings that you've (in RateMyPhoto-> General Options) for max width and max height. Be aware that images with animation trying to be resized they're corrupting (there is a way to fix it but needs a lot of work).

Chris

Live_Bait
11-09-2012, 10:55 PM
Your Mod is so great.. really .. Just the sound of your answer is not good.. I am talking many people posting possible Gif animations if I said they were allowed...and who knows what size they are and such .. I will just make a note that gif animation is not available.. lol
The Mod is good enough with out it..
Thank you!

macroforum
12-17-2012, 11:23 AM
Installed and nominated, works perfect for me!
One question: wich features has commercial version ?
I would lightbox or similar effects :)
Thanks
Antonio

tounet
12-18-2012, 12:34 AM
If you want a specific one, tell me what exactly do you want to show, and I'll give you the code to build it. I don't use to build predefinied widgets/blocks, but rather I'm including my own block generator which can produce many types of them according to your needs, and furthure more to auto install them in your system.

Chris

I want to show the best picture on the sidebar of forumhome soon as I can get the code for widgets/blocks

tounet
01-01-2013, 11:49 AM
I edit the php file with the following code ratemyphoto

<?php

global $vbulletin;
// Setup PHP Enviropment
error_reporting(E_ALL & ~E_NOTICE);
// Define Contants
define('THIS_SCRIPT', 'ratemyphoto');
define('GET_EDIT_TEMPLATES', 'add,edit');
// Cache Templates & Variables
// get special phrase groups
$phrasegroups = array(
'ratemyphoto',
'postbit',
'posting'
);
$specialtemplates = array(
'smiliecache',
'bbcodecache',
'attachmentcache',
);
// Best Photo
$globaltemplates = array(
'block-photo',
'bbcode_code',
'bbcode_html',
'bbcode_php',
'bbcode_quote',
'editor_toolbar_on'
);
// Include Globals
require_once('./global.php');
require_once('./includes/functions_editor.php');
require_once('./includes/functions_newpost.php');
require_once('./includes/functions_user.php');
require_once('./includes/class_bbcode.php');
require_once('./includes/class_image.php');
require_once('./includes/functions_bigthree.php');
require_once('./includes/class_dm.php');
require_once('./includes/class_dm_pm.php');
require_once('./ratemyphoto/includes/functions.php');
require_once('./includes/class_bootstrap_framework.php');
vB_Bootstrap_Framework::init();


$bestphoto =$vbulletin->db->query_first("SELECT * FROM vb_ratemyphoto_photos WHERE approved=1 AND hidden=0 AND rating>0 ORDER BY rating DESC, votes DESC LIMIT 1");
$besttitle = htmlspecialchars_uni($bestphoto["title"]);
$bestphotoname = $bestphoto["logo"];
$bestvotes = $bestphoto["votes"];
$bestrating = $bestphoto["rating"];
$templater = vB_Template::create('block-photo');
$templater->register_page_templates();
$templater->register('besttitle', $besttitle);
$templater->register('bestphotoname', $bestphotoname);
print_output ($templater->render());
?>

This will display the best picture.

and I'm writing a new template block-photo

<div class="block smaller">
<div class="blocksubhead">
<span class="blocktitle">
<vb:if condition="$catid == 0">
{vb:var vbphrase.ratemyphoto_best_overall}
<vb:else />
{vb:var vbphrase.ratemyphoto_best_category}
</vb:if>
</span>
</div>
<div class="widget_content blockbody floatcontainer">
<div class="blockrow" align="center">
<img border="0" src="ratemyphoto/photos/thumbs/{vb:raw bestphotoname}"><br />
{vb:raw besttitle}<br />
{vb:var vbphrase.ratemyphoto_by}: <a href="member.php?u={vb:raw bestuserid}&tab=ratemyphoto#ratemyphoto">{vb:raw bestusername}</a><br />
{vb:var vbphrase.ratemyphoto_votes}: <b>{vb:raw bestvotes}</b><br />
{vb:var vbphrase.ratemyphoto_rating}: <b>{vb:raw bestrating}</b>
</div>
</div>
</div>
<div class="underblock"></div>

I created a block for my sidebare but the image does not appear, or it appears alone overwriting any forum

tounet
01-02-2013, 06:47 PM
if you want to display the home page ratemyphoto with highslide effects change the following template: ratemyphoto_newest_photos by :

<script type="text/javascript" src="http://www.yoursite.com/forum/highslide/highslide-with-gallery.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.yoursite.com/forum/highslide/highslide.css" />
<script type="text/javascript">
hs.graphicsDir = 'http://www.yoursite.com/forum/highslide/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.outlineType = 'rounded-white';
hs.fadeInOut = true;
hs.numberPosition = 'caption';
hs.dimmingOpacity = 0.75;

// Add the controlbar
if (hs.addSlideshow) hs.addSlideshow({
//slideshowGroup: 'group1',
interval: 5000,
repeat: false,
useControls: true,
fixedControls: 'fit',
overlayOptions: {
opacity: .75,
position: 'bottom center',
hideOnMouseOut: true
}
});
</script>
<div class="highslide-gallery">

<td class="blockrow" >
<a id="thumb1" href="ratemyphoto/photos/{vb:raw newestphotoname}" class="highslide" onclick="return hs.expand(this, { slideshowGroup: 1 } )">

<img src="ratemyphoto/photos/thumbs/{vb:raw newestphotoname}" alt="{vb:raw newestphotoname}"
title="Click pour agrandir la photo." /></a><br/>
{vb:raw newesttitle}<br />
{vb:var vbphrase.ratemyphoto_by}: <a href="member.php?u={vb:raw newestuserid}&tab=ratemyphoto#ratemyphoto">{vb:raw newestusername}</a><br />
{vb:var vbphrase.ratemyphoto_in}: <a href="ratemyphoto.php?do=main&catid={vb:raw newestcatid}">{vb:raw newestcategory}</a><br />
{vb:var vbphrase.ratemyphoto_votes}: <b>{vb:raw newestvotes}</b><br/>
{vb:var vbphrase.ratemyphoto_rating}: <b>{vb:raw newestrating}</b>

</td>
</div>

do not forget to create a directory that contains the files highslide:

highslide-with-gallery.js
highslide.css
subdirectory graphics


download it in highslide site her (http://highslide.com/download-confirm.php?file=download%2Fhighslide-4.1.13.zip)

143154 143155
enjoy!

Tyran1
05-09-2013, 04:06 PM
Version for 3.8.7??

Christos Teriakis
08-11-2013, 05:16 PM
Please note that from 11 Aug 2013 you can get support only in my site
http://www.teriakis.com (http://www.teriakis.com)