Can EARNING vodes be implemented with this code?
- serge06
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
16 years 1 month ago #3358
by serge06
I was just wandering if users can earn vodes by posting a message on a Fireboard or SMF forum, or using other components. Would this code work with the "+1" in the $sql = "UPDATE #__vode_credits SET credit=credit+1 WHERE userid='$uid'";
<?php
class Vodes {
function Vodes(){}
function getVodes( $uid ){
$database =& JFactory::getDBO();
$sql = "SELECT credit FROM #__vode_credits WHERE userid='$uid'" ;
$database->setQuery( $sql );
$balance = $database->loadResult();
return $balance ? $balance : 0;
}
function updateVodes( $uid ){
$database =& JFactory::getDBO();
echo $uid;
$sql = "UPDATE #__vode_credits SET credit=credit+1 WHERE userid='$uid'";
$database->setQuery( $sql );
if( !$database->query()) return false;
return true;
}
}
?>
<?php
class Vodes {
function Vodes(){}
function getVodes( $uid ){
$database =& JFactory::getDBO();
$sql = "SELECT credit FROM #__vode_credits WHERE userid='$uid'" ;
$database->setQuery( $sql );
$balance = $database->loadResult();
return $balance ? $balance : 0;
}
function updateVodes( $uid ){
$database =& JFactory::getDBO();
echo $uid;
$sql = "UPDATE #__vode_credits SET credit=credit+1 WHERE userid='$uid'";
$database->setQuery( $sql );
if( !$database->query()) return false;
return true;
}
}
?>
Please Log in or Create an account to join the conversation.
- Saka
- Offline
- Administrator
16 years 1 month ago #3359
by Saka
Emir Sakic
www.sakic.net
Yes, something like that should work.
Emir Sakic
www.sakic.net
Please Log in or Create an account to join the conversation.