Current time: 05-24-2012, 06:16 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ultimate Points and THT Intergration
05-18-2010, 09:37 PM
Post: #1
Ultimate Points and THT Intergration
Hello, im having trouble figuring this out. I have a mod in phpBB called Ultimate Points, and I want to intergrate it with THT. I found this little snippet of code in the p2h.php and im wondering, how do I replace posts with points.

The snippet:
PHP Code:
            case "phpbb":
                
$n 0;
                
$result mysql_query("SELECT * FROM `{$prefix}users` WHERE username = '{$fuser}'"$this->con);
                
$mem mysql_fetch_array($result);
                
$select mysql_query("SELECT * FROM {$prefix}posts WHERE `poster_id` = '{$mem['user_id']}'"$this->con);

                while(
$data2 mysql_fetch_array($select)) {
                    
$date explode(":"strftime("%m:%y" ,$data2['post_time']));
                    if(
$nmonth <= $date[0] && $nyear <= $date[1]) {
                        
$n++;
                    }
                }
                break; 

And the sql table for the counting of the points is in the users table. Can anyone make edits.


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
05-18-2010, 09:44 PM
Post: #2
RE: Ultimate Points and THT Intergration
This would require modification in quite a few places but here you would essentially cut out all the stuff where you check the month. Since it's points, it doesn't really matter what month those points were made in. Make sure you check to see if there are enough points and then subtract them, depending on what you're calling for.

Kevin Mark - TheHostingTool Lead Developer
Visit this user's website Find all posts by this user
Quote this message in a reply
05-18-2010, 09:47 PM (This post was last modified: 05-18-2010 09:47 PM by Ruko.)
Post: #3
RE: Ultimate Points and THT Intergration
Hmm, im confused now, sorry but im a noob in PHP so I don't really know where to edit
Find all posts by this user
Quote this message in a reply
05-18-2010, 09:56 PM
Post: #4
RE: Ultimate Points and THT Intergration
(05-18-2010 09:47 PM)Ruko Wrote:  Hmm, im confused now, sorry but im a noob in PHP so I don't really know where to edit

You need to get the number of current points from the SQL query. Let's say you stored that in $points["has"] and the number of points you need is in $points["required"]. You could check to see if they had enough like so:
PHP Code:
if($points["has"] >= $points["needed"]) {
   
//will be executed if they have enough points
}
else {
   
//will be executed if they don't have enough points

Literally translated that's, "If the number of points I have is greater than or equal to the number of points I need, do this, if not, then do something else

Kevin Mark - TheHostingTool Lead Developer
Visit this user's website Find all posts by this user
Quote this message in a reply
05-18-2010, 10:04 PM
Post: #5
RE: Ultimate Points and THT Intergration
I wouldn't be able to give you any copy and paste code for you to use as I have no idea how your system works but the basic concept should be the same. The specifics, such as the exact SQL query will depend.

Kevin Mark - TheHostingTool Lead Developer
Visit this user's website Find all posts by this user
Quote this message in a reply
05-19-2010, 01:22 AM
Post: #6
RE: Ultimate Points and THT Intergration
Since this isn't a THT issue I moved this to a more appropriate area.

- KuJoe
▒ LvL8
▒ The Free Web Hosting Guide
▒ FreeWebHostingTalk


PM me for theme conversions @ $15!
Visit this user's website Find all posts by this user
Quote this message in a reply
05-19-2010, 03:38 AM
Post: #7
RE: Ultimate Points and THT Intergration
Basically. Change the SQL code to get the number from the points table. It'll work the exact same, just say posts on the script when it's really points.

Jonny H - THT Main Developer & Founder
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)