You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 283 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Hot or Not Module [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
dthiessen
Nuke Soldier
Nuke Soldier


Joined: Jun 08, 2003
Posts: 15


PostPosted: Wed Jul 16, 2003 3:24 pm Reply with quoteBack to top

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
Find all posts by dthiessenView user's profileSend private message
dthiessen
Nuke Soldier
Nuke Soldier


Joined: Jun 08, 2003
Posts: 15


PostPosted: Fri Jul 25, 2003 5:02 pm Reply with quoteBack to top

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.
Find all posts by dthiessenView user's profileSend private message
dthiessen
Nuke Soldier
Nuke Soldier


Joined: Jun 08, 2003
Posts: 15


PostPosted: Sat Jul 26, 2003 9:44 am Reply with quoteBack to top

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
Find all posts by dthiessenView user's profileSend private message
dthiessen
Nuke Soldier
Nuke Soldier


Joined: Jun 08, 2003
Posts: 15


PostPosted: Sat Jul 26, 2003 11:19 am Reply with quoteBack to top

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.

You can see the module at http://thehub.syte.snet/modules.php?name=hotornot
Find all posts by dthiessenView user's profileSend private message
Mesum
Support Staff
Support Staff


Joined: Mar 11, 2003
Posts: 842

Location: Chicago

PostPosted: Sun Jul 27, 2003 2:32 am Reply with quoteBack to top

It looks bueatiful dude!!!
I love you!!!
When it is going to be released?

_________________
Only FREE Dating site for Desis.
Find all posts by MesumView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
Mesum
Support Staff
Support Staff


Joined: Mar 11, 2003
Posts: 842

Location: Chicago

PostPosted: Mon Jul 28, 2003 2:57 am Reply with quoteBack to top

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

Does it even worth to release this script?

_________________
Only FREE Dating site for Desis.
Find all posts by MesumView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
dthiessen
Nuke Soldier
Nuke Soldier


Joined: Jun 08, 2003
Posts: 15


PostPosted: Tue Jul 29, 2003 3:04 pm Reply with quoteBack to top

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.
Find all posts by dthiessenView user's profileSend private message
JackX
Corporal
Corporal


Joined: Feb 12, 2003
Posts: 58

Location: USA

PostPosted: Tue Sep 16, 2003 1:06 pm Reply with quoteBack to top

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:

include("/YOUR/WEBSITE/PATHTO/modules/Hot_Or_Not/h_config.php");

Change /YOUR/WEBSITE/PATHTO to your server's root path to your PHP-Nuke root dir.

IMPORTANT: If you do not change that path, you get grt errors on your PHP-Nuke website and PHPbb Admin section.


I'm no professional php coder, but the following line of code looks odd:
Code:
(include_path='.:/usr/lib/php:/usr/local/lib/php')


Any pointers?
Thanks, I would have asked chicagobase but their site says they provide no support, figured I'd ask the pros here. Cool
Find all posts by JackXView user's profileSend private message
Mesum
Support Staff
Support Staff


Joined: Mar 11, 2003
Posts: 842

Location: Chicago

PostPosted: Tue Sep 16, 2003 3:05 pm Reply with quoteBack to top

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.

_________________
Only FREE Dating site for Desis.
Find all posts by MesumView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
JackX
Corporal
Corporal


Joined: Feb 12, 2003
Posts: 58

Location: USA

PostPosted: Tue Sep 16, 2003 5:26 pm Reply with quoteBack to top

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());

      setcookie("vote_cookie[".$nr."]", $value, time() + ($expiration * 3600));
   }
   return $return;
}

global $img_redirect, $img_expiration;
//check if parameters are valid
if (isset($v_nr) && $v_nr != "" && isset($v_rate) && $v_rate != "") {
   //rating only between 1 and 10
   if ($v_rate >= 1 && $v_rate <= 10) {
      //check if voting is allowed
      if (vote_cookie($v_nr, $img_expiration)) {
         //check if entry exists in table
         $result = sql_query("select vote_id, vote_nr, vote_total, vote_".$v_rate." from ".$prefix."_hotornot_votes where vote_id = $v_nr", $dbi);
         list($vote_id, $vote_nr, $vote_total, $vote_rate) = sql_fetch_row($result, $dib);
         //if entry exists, add 1 to voting nr and update record!
         if (sql_num_rows($result, $dbi) > 0) {
            $vote_nr++;
            $vote_total = $vote_total + $v_rate;
            $result = sql_query("update ".$prefix."_hotornot_votes set vote_datetime = now(), vote_nr = $vote_nr, vote_total = $vote_total, vote_".$v_rate." = vote_".$v_rate." + 1 where vote_id = $vote_id", $dbi);
         }
      }
   }
   //get url for redirecting!!
   $doc = $_SERVER['PHP_SELF'];
   //backwards compatibility for version older then PHP 4.2.0
   //if ($doc == "") $doc = $HTTP_SERVER_VARS['PHP_SELF'];
   //get querystring
   $querystring = $_SERVER['QUERY_STRING'];
   //backwards compatibility for version older then PHP 4.2.0
   //if ($querystring == "") $querystring = $HTTP_SERVER_VARS['QUERY_STRING'];
   if ($img_redirect == 0 || !eregi("name=Hot_Or_Not",$querystring)) {
      //No? then use index.php
      if ($doc == "") $doc = "index.php";
      //remove vote parameters from querystring
      $search = array("/&{0,1}v_nr=[0-9a-zA-Z\.]{1,10}/", "/&{0,1}v_rate=[0-9]{1,10}/");
      $querystring = preg_replace ($search, "", $querystring);
      //build total url
      if ($querystring != "") {
         $doc .= "?".$querystring;
      }
   }
   else {
      //if redirect is to module!
      $doc = "modules.php?name=Hot_Or_Not";
   }
  echo "
  <script language=\"javascript\">
  window.location=\"$doc\"
  </script>
  ";
}

?>
Find all posts by JackXView user's profileSend private message
Mesum
Support Staff
Support Staff


Joined: Mar 11, 2003
Posts: 842

Location: Chicago

PostPosted: Tue Sep 16, 2003 7:13 pm Reply with quoteBack to top

No, use this line instead:
Code:

/home/dvd/public_html/modules/Hot_Or_Not/h_config.php

Copy and past it exactly as I have posted above into your rate.php file, where to have line:
Code:

include("/modules/Hot_Or_Not/h_config.php");


So, it will look like this:
Code:

include("/home/dvd/public_html/modules/Hot_Or_Not/h_config.php");

Good luck.

_________________
Only FREE Dating site for Desis.
Find all posts by MesumView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
JackX
Corporal
Corporal


Joined: Feb 12, 2003
Posts: 58

Location: USA

PostPosted: Tue Sep 16, 2003 7:32 pm Reply with quoteBack to top

That did it, but could you look at the code for a second, it seems to be logging me out of the site while voting.
Find all posts by JackXView user's profileSend private message
Mesum
Support Staff
Support Staff


Joined: Mar 11, 2003
Posts: 842

Location: Chicago

PostPosted: Tue Sep 16, 2003 7:42 pm Reply with quoteBack to top

Can I have the link to the module please?

_________________
Only FREE Dating site for Desis.
Find all posts by MesumView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
Mesum
Support Staff
Support Staff


Joined: Mar 11, 2003
Posts: 842

Location: Chicago

PostPosted: Tue Sep 16, 2003 7:46 pm Reply with quoteBack to top

Or even better, catch me online sometime using my AIM, Yahoo! or MSN screen names.

_________________
Only FREE Dating site for Desis.
Find all posts by MesumView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
mcp_dk
Nuke Soldier
Nuke Soldier


Joined: Jul 15, 2003
Posts: 31


PostPosted: Mon Oct 27, 2003 4:16 am Reply with quoteBack to top

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
Find all posts by mcp_dkView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.164 Seconds - 428 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::