Does anyone know of a free hot or not module that is out there or a script that i can convert to a module. Even a simple one will do. I can build on it from there
dthiessen Nuke Soldier
Joined: Jun 08, 2003
Posts: 15
Posted:
Fri Jul 25, 2003 5:02 pm
Oh well...i guess nobody does have one, so I decided to mod one over from some existing code on sourceforge. I am having trouble with a little bit of code though. In this function:
Code:
function getRandomUser()
{
global $prefix, $dbi;
srand((double)microtime()*1000000);
$query = sql_query("select * FROM ".$prefix."_hotornot where active=1 and inrotation = 1", $dbi);
$rows = sql_fetch_row($query, $dbi);
if ($rows==0)
return Array('id'=>-1, "uid"=>'', "picurl"=>'');
$row = rand(0, $rows - 1);
sql_data_seek($query, $row, $dbi);
$record = sql_fetch_array($query, $dbi);
return $record;
}
It seems to get stuck on the $row = rand(0, $rows - 1); line. It gives me the following error:
Code:
Unsupported operand types in /var/www/html/modules/hotornot/prep.php on line 43
. Being that I'm very new at php and this is the first time I've ever tried make my own module I have no clue how to debug this error.
dthiessen Nuke Soldier
Joined: Jun 08, 2003
Posts: 15
Posted:
Sat Jul 26, 2003 9:44 am
Alright...I fixed everything except that when i try to vote...it votes...but it doesn't randomize a new picture. It is caught in a continuous loop somewhere.
Any help at all would be much appreciated. As soon as I fix this, the module will be released on NukeCops. etc.
Last edited by dthiessen on Sat Jul 26, 2003 2:02 pm; edited 1 time in total
dthiessen Nuke Soldier
Joined: Jun 08, 2003
Posts: 15
Posted:
Sat Jul 26, 2003 11:19 am
Alright, I have fixed all the bugs and everything works good now. All that is left is to make it a standardized module for php-nuke and then find out how to intergrate it with the already made php-nuke users. Any help on this would be much appreciated. Thanks.
Ok, I just finished one old module that was made for 5.5.
Auther's website is gone, no credits were on the script but there are some for trashbin.net in the readme file.
Got it working with my 6.7 and if anyone of you wanna check it out, it can be found here.
http://www.chicagobase.com/gate.html?name=Hot_Or_Not
Ok...it's a long way from being finished now but at least it half works. You can download it from http://thehub.sytes.net/modules.php?name=Downloads&d_op=getit&lid=32. Feel free to add to the module and complete some of the things in the readme that have to be done if you get bored with it. The only thing that i've found is that unless you have a whole bunch of pictures, they get sort of repetetive. I want the pictures to be displayed linear instead of random.
JackX Corporal
Joined: Feb 12, 2003
Posts: 58
Location: USA
Posted:
Tue Sep 16, 2003 1:06 pm
I have a question about the module downloaded from ChicagoBase
I get the following error at the top of my site when I use the included mainfile.php. I also get the same error when I add the line of code to my existing mainfile.php. Looks like it's not finding a file to me, but they are all where they are supposed to be.
Code:
Warning: main(/modules/Hot_Or_Not/h_config.php): failed to open stream: No such file or directory in /home/dvd/public_html/modules/Hot_Or_Not/rate.php on line 29
Warning: main(): Failed opening '/modules/Hot_Or_Not/h_config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dvd/public_html/modules/Hot_Or_Not/rate.php on line 29
Here are the instructions that I feel apply, and I have followed them thoroughly, but I cannot get this to work, which makes rating an image impossible.
Code:
3. IMPORTANT: copy the mainfile.php to your PHP-Nuke root dir.
Don't worry, the file is same in 6.5/.6/.7/.8/.9 and I am uptodate with all the security patches.
If you are using NC Nuke bundle, please look at the line of code I have added, will look something like this:
############################################################################
# Code for Hot or Not module by ::Trashbin:: 2002 and ChicagoBase.com 2003 #
############################################################################
require_once("modules/Hot_Or_Not/rate.php");
############################################################################
and change your mainfile.php to match it.
------------------------------------------------------------
NOTE: Without this change, rating of images will NOT work.
-------------------------------------------------------------
in modules/Hot_Or_Not/rate.php, on line 29, you will see some code that looks like this:
Any pointers?
Thanks, I would have asked chicagobase but their site says they provide no support, figured I'd ask the pros here.
Mesum Support Staff
Joined: Mar 11, 2003
Posts: 842
Location: Chicago
Posted:
Tue Sep 16, 2003 3:05 pm
Did you change the path to server's root file in rate.php at it was told in ReadMe file? and also if you don't mind, please paste your rete.php file here too.
Here is my rate.php, nuke itself is loaded in the root of the site. I have also tried using the full path, including http:// but that does not work either. Appreciate your time.
Code:
<?php
# ******************************************************************************
# PHPnuke Hot or Not v2.0
#
# for PHPnuke 5.5
#
# Download at: http://www.trashbin.net
#
# Copyright (C) 2002 by ::Trashbin:: http://www.trashbin.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# ******************************************************************************
if (eregi("rate.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
//get config file. PLEASE CHANGE /YOUR/WEBSITE/PATHTO to your server's root path. else, you will get errors in your PHPbb admin section.
include("/modules/Hot_Or_Not/h_config.php");
function vote_cookie($nr, $expiration) {
//check if user has already voted on the image
//in the last defined time period.
global $vote_cookie;
//check if cookie exists
if ($vote_cookie[$nr] == null) {
//cookie did not exist, voting is allowed
$return = true;
} else {
//check difference between expiration date and now
$value = base64_decode($vote_cookie[$nr]);
//check if timedifference is bigger then defined in config file
if (time() -$value > ($expiration * 3600)) {
$return = true;
} else {
$return = false;
}
}
//if voting allowed set cookie!
if ($return) {
//set time as cookie value
$value = base64_encode(time());
was this module ever fininshed?? I would love a copy of it. I am converting an old phpmuke 5.5 to a 6.9 and i need a hot_or_not module as i don't think the old one will work with 6.9
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum