LTD Script [CROSS-COMPATIBLE][PHOENIX]

Results 1 to 24 of 24
  1. #1
    Run, but I'll find you. Ddos Attack is offline
    MemberRank
    Jan 2011 Join Date
    AustraliaLocation
    908Posts

    config LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Hey again guys,

    As Phoenix is still not using an SWF that allows you to buy LTD Rares from inside of the client, I decided to create a little LTD Script that you can set up on your homepage :)

    Its mainly compatible with UberCMS, and with a little editing, it should work great on other CMS's too.

    This script lets you add an LTD Rare, and then put it on sale, and let people buy it via your homepage.

    Example:

    PHP :
    PHP Code:
        <div class="limited-edition">
        <?php
        $getRare 
    dbquery("SELECT * FROM rares ORDER BY timestamp DESC LIMIT 1");
        
    $rare mysql_fetch_assoc($getRare);
            
    $getUser dbquery("SELECT * FROM users WHERE id = '".USER_ID."' LIMIT 1");
            
    $user mysql_fetch_assoc($getUser);

            if(isset(
    $_POST['submit'])){
                if(
    $user['credits'] >= $rare['credits'] AND $user['vip_points'] >= $rare['vip_points'] AND $rare['amount'] >= 1){
                
    dbquery("UPDATE rares SET amount = amount - 1 WHERE id = '".$rare['id']."'");
                
    dbquery("UPDATE users SET credits = credits - ".$rare['credits'].", vip_points = vip_points - ".$rare['vip_points']." WHERE id = '".USER_ID."'");
                
    $item $rare['item_ids'];
                
    $page $rare['page_id'];
                
    $core->Mus'giveitem'USER_ID ' '.$item.' '.$page.' Enjoy your Limited Edition furni! Keep checking for more Limited Edition furnis!');
                
    $core->Mus'updatepoints'USER_ID );
                
    $core->Mus'updatecredits'USER_ID );
                
    header("Location: ".WWW."/client");
                    }
                }

            echo
    '
            <div class="image" style="background:url(\''
    .$rare['image'].'\') no-repeat;background-position:center center;"></div>
            <div class="details">
                <div class="header"></div>
            <span class="item-name"><b>'
    .$rare['name'].'</b> '.$rare['caption'].'</span>
            <span class="item-desc">Amount available: <b>'
    .$rare['amount'].'</b>
            <BR>Price:<b>'
    ;
                if(
    $rare['credits'] >= $rare['vip_points'] >= 1){
                echo
    ' '.$rare['credits'].' credits + '.$rare['vip_points'].' shells ';
                }
                elseif(
    $rare['credits'] >= $rare['vip_points'] == 0) {
                echo
    ' '.$rare['credits'].' credits ';
                }
                elseif(
    $rare['credits'] == $rare['vip_points'] >= 1) {
                echo
    ' '.$rare['vip_points'].' shells ';
                }
                elseif(
    $rare['credits'] == $rare['vip_points'] == 0) {
                echo
    ' Free! ';
                }
                echo 
    '</b></span>';
                if(
    $rare['amount'] >= $user['credits'] >= $rare['credits'] & $user['vip_points'] >= $rare['vip_points']) {
                echo
    ' <form method="post"><input type="submit" name="submit" value="Buy" /></form> ';
                }
                elseif(
    $rare['amount'] >= $user['credits'] < $rare['credits']) {
                echo
    ' <input type="submit" name="currency" value="Not enough credits!" /> ';
                }
                elseif(
    $rare['amount'] >= $user['vip_points'] < $rare['vip_points']) {
                echo
    ' <input type="submit" name="currency" value="Not enough shells!" /> ';
                }
                elseif(
    $rare['amount'] == 0) {
                echo
    '<input type="submit" name="none" value="Sold Out!" />';
            }
            echo
    '</div>';
        
    ?>
    </div>
    SQL:
    PHP Code:
    CREATE TABLE IF NOT EXISTS `rares` (
      `
    idint(10NOT NULL AUTO_INCREMENT,
      `
    timestamptimestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
      `
    item_idsint(120NOT NULL,
      `
    page_idint(120NOT NULL,
      `
    namevarchar(100NOT NULL,
      `
    captionvarchar(150NOT NULL,
      `
    amountint(10NOT NULL,
      `
    creditsint(10NOT NULL DEFAULT '0',
      `
    vip_pointsint(10NOT NULL DEFAULT '0',
      `
    imagevarchar(500NOT NULL,
      
    PRIMARY KEY (`id`)
    ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=


    I think it needs a little bit of re-coding considering I created this script when I was still in the process of getting a grip of PHP (which was a few months ago).
    There is also no style sheet associated with the script, so you will need to design the look and feel of it.
    This script is also compatible with Phoenix, as once you "buy" the furni, it will update your credits/pixels/shells and also automatically insert the item into your Inventory using MUS.
    At the time of coding this, I tried to make it as flexible as possible, meaning that you are able to pick the currency the LTD is - credits / pixels / shells. If you want an image of the LTD Rare to display, you will need to save the image in your directory, and in the "image" area of the "rares" table, the link to the image will go there.

    If you have any questions about this release, feel free to ask. I'll try to help you as best as possible.

    Like + Rep if you like this release

    Thanks
    - Nicholas
    Last edited by Ddos Attack; 22-12-12 at 05:43 AM.


  2. #2

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Is this the one that there are a limited amount of rares, and you have buy them before they run out?

  3. #3
    Run, but I'll find you. Ddos Attack is offline
    MemberRank
    Jan 2011 Join Date
    AustraliaLocation
    908Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Quote Originally Posted by Weytin View Post
    Is this the one that there are a limited amount of rares, and you have buy them before they run out?
    Exactly how it works! You give a certain amount of that particular rare, and once it runs out, it will display "Sold Out". Of course though, you can add additional "amounts" with the database :)

  4. #4
    Apprentice LikeOMG is offline
    MemberRank
    Dec 2012 Join Date
    17Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Can someone convert this for RevCMS?

  5. #5

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Quote Originally Posted by Ddos Attack View Post
    Exactly how it works! You give a certain amount of that particular rare, and once it runs out, it will display "Sold Out". Of course though, you can add additional "amounts" with the database :)
    That's what I was hoping for, thanks.

  6. #6
    Full-Stack Web Developer Emetophobic is offline
    MemberRank
    Jan 2012 Join Date
    Nice, FranceLocation
    238Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Thanks ! :D You didn't even forgot the Mus shit for automatic delivering. Must-have til Phoenix 4

  7. #7
    Account Upgraded | Title Enabled! JustTime is offline
    MemberRank
    Aug 2012 Join Date
    GermanyLocation
    417Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Thanks so much. Like + Rep for you <3 *-*

  8. #8
    Full-Stack Web Developer Emetophobic is offline
    MemberRank
    Jan 2012 Join Date
    Nice, FranceLocation
    238Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Here's my style for the script:

    Code:
    <?php
    $getRare = dbquery("SELECT * FROM rares ORDER BY timestamp DESC LIMIT 1");
            $getUser = dbquery("SELECT * FROM users WHERE id = '".USER_ID."' LIMIT 1");
            $user = mysql_fetch_assoc($getUser);
          
        if(isset($_POST['submit'])){
                if($user['credits'] >= $rare['credits'] AND $user['vip_points'] >= $rare['vip_points'] AND $rare['amount'] >= 1){
                dbquery("UPDATE rares SET amount = amount - 1 WHERE id = '".$rare['id']."'");
                dbquery("UPDATE users SET credits = credits - ".$rare['credits'].", vip_points = vip_points - ".$rare['vip_points']." WHERE id = '".USER_ID."'");
                $item = $rare['item_ids'];
                $page = $rare['page_id'];
                $core->Mus('giveitem', USER_ID . ' '.$item.' '.$page.' Voilà ton mobis édition limitée est livré!');
                $core->Mus('updatepoints', USER_ID );
                $core->Mus('updatecredits', USER_ID );
                header("Location: ".WWW."/client");
                    }
                }
                echo '<div class="habblet-container ">		
                      <div class="cbb clearfix red ">
                      <h2 class="title"><span style="float: left;">Édition limitée</span></h2>
                      <div class="box-content">';
                      
                if (mysql_num_rows($getRare) > 0)
                    {
                        $oe = 1;
    		
                        while ($rare = mysql_fetch_assoc($getRare))
                            {
                                if ($oe == 2)
                                    {
                                        $oe = 1;
                                    }
                                else
                                    {
                                        $oe = 2;
                                    }
                echo '<table width="107%" style="padding: 5px; margin-left: -15px; background-color: ' . (($oe == 2) ? '#fff' : '#E6E6E6') . ';">
    			<tbody>
    				<tr>
    					<td valign="middle" width="25">
                            <img style="margin-top: -10px;" src="' . $rare['image'] . '">
                        </td>
    					<td valign="top">
                        <b style="font-size: 110%;">' . $rare['name'] . '</b><br />
    						<i>' . $rare['caption'] . '</i><br />
                        Quantité restante: <b>' . $rare['amount'] . '<br />
                        Prix:<b>';
                        if($rare['credits'] >= 1 & $rare['vip_points'] >= 1){
                        echo' '.$rare['credits'].' Crédits + '.$rare['vip_points'].' Coquillages ';
                        }
                        elseif($rare['credits'] >= 1 & $rare['vip_points'] == 0) {
                        echo' '.$rare['credits'].' Crédits ';
                        }
                        elseif($rare['credits'] == 0 & $rare['vip_points'] >= 1) {
                        echo' '.$rare['vip_points'].' Coquillages ';
                        }
                        elseif($rare['credits'] == 0 & $rare['vip_points'] == 0) {
                        echo' Gratuit! ';
                        }
                        echo '</b><br />';
                        if($rare['amount'] >= 1 & $user['credits'] >= $rare['credits'] & $user['vip_points'] >= $rare['vip_points']) {
                        echo '<form method="post"><input type="submit" value="Acheter" name="buy" class="submit" style="float: right;" /></form>';
                        }
                        elseif($rare['amount'] >= 1 & $user['credits'] < $rare['credits']) {
                        echo '<br><b style="float: right;">Pas assez de crédits</b>';
                        }
                        elseif($rare['amount'] >= 1 & $user['vip_points'] < $rare['vip_points']) {
                        echo '<br><b style="float: right;">Pas assez de coquillages</b>';
                        }
                        elseif($rare['amount'] == 0) {
                        echo '<br><b style="float: right;">Plus en stock</b>';
                        }
                        echo '</td>
                    </tr>
                </tbody>
                </table>';
            }
        }
        else
        {
            echo '<i>Il n\'y a aucune vente active pour le moment</i>';
        }
      
    echo '</div>
    	</div> 
    </div> 
    <script type="text/javascript">if (!$(document.body).hasClassName(\'process-template\')) { Rounder.init(); }</script> ';
    
    ?>


    But when I click on the button it does nothing, the script load but it seems to don't execute SQL queries and MUS Commands

  9. #9
    Novice CarbonDEV is offline
    MemberRank
    Dec 2012 Join Date
    1Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Hmm.. Do I smell exploitable scripts from an exploitable CMS or is it just me?
    Anyways, good for people who like Phoenix and who want LTD shit, however it would be better if somebody made a AS3 script for it.

  10. #10
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,610Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    No need for me. Got LTD working at Butterstorm :P Would be a bit double to add it to the CMS too :P

    Also is this that same LTD you once showed me and I've been asking three months ago?

  11. #11
    Full-Stack Web Developer Emetophobic is offline
    MemberRank
    Jan 2012 Join Date
    Nice, FranceLocation
    238Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Fixed it myself, the code is a lot messy (Actually the Mus function for uber is in the page can't get it working from a require_once with the global.php file):

    PHP Code:
    <?php
    function Mus($header$data '')
        {
            
    $musData $header chr(1) . $data;
            
    $sock = @socket_create(AF_INETSOCK_STREAMgetprotobyname('tcp'));
            @
    socket_connect($sock'127.0.0.1''30001');
            @
    socket_send($sock$musDatastrlen($musData), MSG_DONTROUTE);
            @
    socket_close($sock);
        }
    $getRare dbquery("SELECT * FROM rares ORDER BY timestamp DESC LIMIT 1");
    $rare mysql_fetch_assoc($getRare);
            
    $getUser dbquery("SELECT * FROM users WHERE id = '".USER_ID."' LIMIT 1");
            
    $user mysql_fetch_assoc($getUser);
          
        if(isset(
    $_POST['submit'])){
                if(
    $user['credits'] >= $rare['credits'] AND $user['vip_points'] >= $rare['vip_points'] AND $rare['amount'] >= 1){
                
    dbquery("UPDATE rares SET amount = amount - 1 WHERE id = '".$rare['id']."'");
                
    dbquery("UPDATE users SET credits = credits - ".$rare['credits'].", vip_points = vip_points - ".$rare['vip_points']." WHERE id = '".USER_ID."'");
                
    $item $rare['item_ids'];
                
    $page $rare['page_id'];
                
    Mus('giveitem'USER_ID ' '.$item.' '.$page.' Voilà ton mobis édition limitée est livré!');
                
    Mus('updatepoints'USER_ID );
                
    Mus('updatecredits'USER_ID );
                    }
                }
                echo 
    '<div class="habblet-container ">        
                      <div class="cbb clearfix red ">
                      <h2 class="title"><span style="float: left;">Édition limitée</span></h2>
                      <div class="box-content">'
    ;
                      
                if (
    mysql_num_rows($getRare) > 0)
                    {
                        
    $oe 1;
                    }
                                if (
    $oe == 2)
                                    {
                                        
    $oe 1;
                                    }
                                else
                                    {
                                        
    $oe 2;
                                    }
                echo 
    '<table width="107%" style="padding: 5px; margin-left: -15px; background-color: ' . (($oe == 2) ? '#fff' '#E6E6E6') . ';">
                <tbody>
                    <tr>
                        <td valign="middle" width="25">
                            <img style="margin-top: -10px;" src="' 
    $rare['image'] . '">
                        </td>
                        <td valign="top">
                        <b style="font-size: 110%;">' 
    $rare['name'] . '</b><br />
                            <i>' 
    $rare['caption'] . '</i><br />
                        Quantité restante: <b>' 
    $rare['amount'] . '<br />
                        Prix:<b>'
    ;
                        if(
    $rare['credits'] >= $rare['vip_points'] >= 1){
                        echo
    ' '.$rare['credits'].' Crédits + '.$rare['vip_points'].' Coquillages ';
                        }
                        elseif(
    $rare['credits'] >= $rare['vip_points'] == 0) {
                        echo
    ' '.$rare['credits'].' Crédits ';
                        }
                        elseif(
    $rare['credits'] == $rare['vip_points'] >= 1) {
                        echo
    ' '.$rare['vip_points'].' Coquillages ';
                        }
                        elseif(
    $rare['credits'] == $rare['vip_points'] == 0) {
                        echo
    ' Gratuit! ';
                        }
                        echo 
    '</b><br />';
                        if(
    $rare['amount'] >= $user['credits'] >= $rare['credits'] & $user['vip_points'] >= $rare['vip_points']) {
                        echo 
    '<form method="post"><input type="submit"  class="submit" style="float: right;" name="submit" value="Acheter" /></form>';
                        }
                        elseif(
    $rare['amount'] >= $user['credits'] < $rare['credits']) {
                        echo 
    '<br><b style="float: right;">Pas assez de crédits</b>';
                        }
                        elseif(
    $rare['amount'] >= $user['vip_points'] < $rare['vip_points']) {
                        echo 
    '<br><b style="float: right;">Pas assez de coquillages</b>';
                        }
                        elseif(
    $rare['amount'] == 0) {
                        echo 
    '<br><b style="float: right;">Plus en stock</b>';
                        }
                        echo 
    '</td>
                    </tr>
                </tbody>
                </table>'
    ;
      
    echo 
    '</div>
        </div> 
    </div> 
    <script type="text/javascript">if (!$(document.body).hasClassName(\'process-template\')) { Rounder.init(); }</script> '
    ;

    ?>
    Now the code is compatible with every CMS that use PHP ^^

  12. #12

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Quote Originally Posted by Emetophobic View Post
    Fixed it myself, the code is a lot messy (Actually the Mus function for uber is in the page can't get it working from a require_once with the global.php file):

    PHP Code:
    <?php
    function Mus($header$data '')
        {
            
    $musData $header chr(1) . $data;
            
    $sock = @socket_create(AF_INETSOCK_STREAMgetprotobyname('tcp'));
            @
    socket_connect($sock'127.0.0.1''30001');
            @
    socket_send($sock$musDatastrlen($musData), MSG_DONTROUTE);
            @
    socket_close($sock);
        }
    $getRare dbquery("SELECT * FROM rares ORDER BY timestamp DESC LIMIT 1");
    $rare mysql_fetch_assoc($getRare);
            
    $getUser dbquery("SELECT * FROM users WHERE id = '".USER_ID."' LIMIT 1");
            
    $user mysql_fetch_assoc($getUser);
          
        if(isset(
    $_POST['submit'])){
                if(
    $user['credits'] >= $rare['credits'] AND $user['vip_points'] >= $rare['vip_points'] AND $rare['amount'] >= 1){
                
    dbquery("UPDATE rares SET amount = amount - 1 WHERE id = '".$rare['id']."'");
                
    dbquery("UPDATE users SET credits = credits - ".$rare['credits'].", vip_points = vip_points - ".$rare['vip_points']." WHERE id = '".USER_ID."'");
                
    $item $rare['item_ids'];
                
    $page $rare['page_id'];
                
    Mus('giveitem'USER_ID ' '.$item.' '.$page.' Voilà ton mobis édition limitée est livré!');
                
    Mus('updatepoints'USER_ID );
                
    Mus('updatecredits'USER_ID );
                    }
                }
                echo 
    '<div class="habblet-container ">        
                      <div class="cbb clearfix red ">
                      <h2 class="title"><span style="float: left;">Édition limitée</span></h2>
                      <div class="box-content">'
    ;
                      
                if (
    mysql_num_rows($getRare) > 0)
                    {
                        
    $oe 1;
                    }
                                if (
    $oe == 2)
                                    {
                                        
    $oe 1;
                                    }
                                else
                                    {
                                        
    $oe 2;
                                    }
                echo 
    '<table width="107%" style="padding: 5px; margin-left: -15px; background-color: ' . (($oe == 2) ? '#fff' '#E6E6E6') . ';">
                <tbody>
                    <tr>
                        <td valign="middle" width="25">
                            <img style="margin-top: -10px;" src="' 
    $rare['image'] . '">
                        </td>
                        <td valign="top">
                        <b style="font-size: 110%;">' 
    $rare['name'] . '</b><br />
                            <i>' 
    $rare['caption'] . '</i><br />
                        Quantité restante: <b>' 
    $rare['amount'] . '<br />
                        Prix:<b>'
    ;
                        if(
    $rare['credits'] >= $rare['vip_points'] >= 1){
                        echo
    ' '.$rare['credits'].' Crédits + '.$rare['vip_points'].' Coquillages ';
                        }
                        elseif(
    $rare['credits'] >= $rare['vip_points'] == 0) {
                        echo
    ' '.$rare['credits'].' Crédits ';
                        }
                        elseif(
    $rare['credits'] == $rare['vip_points'] >= 1) {
                        echo
    ' '.$rare['vip_points'].' Coquillages ';
                        }
                        elseif(
    $rare['credits'] == $rare['vip_points'] == 0) {
                        echo
    ' Gratuit! ';
                        }
                        echo 
    '</b><br />';
                        if(
    $rare['amount'] >= $user['credits'] >= $rare['credits'] & $user['vip_points'] >= $rare['vip_points']) {
                        echo 
    '<form method="post"><input type="submit"  class="submit" style="float: right;" name="submit" value="Acheter" /></form>';
                        }
                        elseif(
    $rare['amount'] >= $user['credits'] < $rare['credits']) {
                        echo 
    '<br><b style="float: right;">Pas assez de crédits</b>';
                        }
                        elseif(
    $rare['amount'] >= $user['vip_points'] < $rare['vip_points']) {
                        echo 
    '<br><b style="float: right;">Pas assez de coquillages</b>';
                        }
                        elseif(
    $rare['amount'] == 0) {
                        echo 
    '<br><b style="float: right;">Plus en stock</b>';
                        }
                        echo 
    '</td>
                    </tr>
                </tbody>
                </table>'
    ;
      
    echo 
    '</div>
        </div> 
    </div> 
    <script type="text/javascript">if (!$(document.body).hasClassName(\'process-template\')) { Rounder.init(); }</script> '
    ;

    ?>
    Now the code is compatible with every CMS that use PHP ^^
    No, it isn't. Uber there are still some functions inside that other CMS' don't use.

    Example: There are dbquery is an undefined method if you use this on other CMS', and USER_ID is an undefined constant.

    Change all the dbquery(); functions to mysql_query for it to be compatible with other CMS'.

  13. #13
    Full-Stack Web Developer Emetophobic is offline
    MemberRank
    Jan 2012 Join Date
    Nice, FranceLocation
    238Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Quote Originally Posted by Weytin View Post
    No, it isn't. Uber there are still some functions inside that other CMS' don't use.

    Example: There are dbquery is an undefined method if you use this on other CMS', and USER_ID is an undefined constant.

    Change all the dbquery(); functions to mysql_query for it to be compatible with other CMS'.
    Yoops, thanks for telling me. ^^'

  14. #14
    Gamma Spamma Liam is online now
    MemberRank
    Dec 2011 Join Date
    Down UnderLocation
    2,945Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    I was expecting it to be working in the client for a second there =) Seems nice though.. But maybe make it have a little LTD theme :p? Thanks though!

  15. #15

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Quote Originally Posted by Emetophobic View Post
    Yoops, thanks for telling me. ^^'
    No problem. Like/Rep my post if I helped. :P

  16. #16
    Novice Ivan Zinzi is offline
    MemberRank
    Jul 2012 Join Date
    1Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Can u tell me HoloCms script?

    Thank You

  17. #17
    Run, but I'll find you. Ddos Attack is offline
    MemberRank
    Jan 2011 Join Date
    AustraliaLocation
    908Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Quote Originally Posted by tdid View Post
    No need for me. Got LTD working at Butterstorm :P Would be a bit double to add it to the CMS too :P

    Also is this that same LTD you once showed me and I've been asking three months ago?
    Yes it is

  18. #18
    Member Beljac08 is offline
    MemberRank
    Feb 2010 Join Date
    79Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    I get 500 error. Screenshot by Lightshot

  19. #19
    Run, but I'll find you. Ddos Attack is offline
    MemberRank
    Jan 2011 Join Date
    AustraliaLocation
    908Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Quote Originally Posted by Beljac08 View Post
    I get 500 error. Screenshot by Lightshot
    Make sure it is made for your CMS. Make sure global.php is linked somewhere in the file

  20. #20
    Apprentice LikeOMG is offline
    MemberRank
    Dec 2012 Join Date
    17Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Can anyone be kind enough to change it to something that works on RevCMS? Thanks.

  21. #21

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Quote Originally Posted by LikeOMG View Post
    Can anyone be kind enough to change it to something that works on RevCMS? Thanks.
    Currently working on it.

  22. #22
    Goin Goin Gone! LHaZze is offline
    MemberRank
    Mar 2011 Join Date
    VirginiaLocation
    695Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Good job, I love this!

  23. #23
    Member CookieMonst is offline
    MemberRank
    Jul 2012 Join Date
    62Posts

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Quote Originally Posted by Emetophobic View Post
    Here's my style for the script:

    Code:
    <?php
    $getRare = dbquery("SELECT * FROM rares ORDER BY timestamp DESC LIMIT 1");
            $getUser = dbquery("SELECT * FROM users WHERE id = '".USER_ID."' LIMIT 1");
            $user = mysql_fetch_assoc($getUser);
          
        if(isset($_POST['submit'])){
                if($user['credits'] >= $rare['credits'] AND $user['vip_points'] >= $rare['vip_points'] AND $rare['amount'] >= 1){
                dbquery("UPDATE rares SET amount = amount - 1 WHERE id = '".$rare['id']."'");
                dbquery("UPDATE users SET credits = credits - ".$rare['credits'].", vip_points = vip_points - ".$rare['vip_points']." WHERE id = '".USER_ID."'");
                $item = $rare['item_ids'];
                $page = $rare['page_id'];
                $core->Mus('giveitem', USER_ID . ' '.$item.' '.$page.' Voilà ton mobis édition limitée est livré!');
                $core->Mus('updatepoints', USER_ID );
                $core->Mus('updatecredits', USER_ID );
                header("Location: ".WWW."/client");
                    }
                }
                echo '<div class="habblet-container ">		
                      <div class="cbb clearfix red ">
                      <h2 class="title"><span style="float: left;">Édition limitée</span></h2>
                      <div class="box-content">';
                      
                if (mysql_num_rows($getRare) > 0)
                    {
                        $oe = 1;
    		
                        while ($rare = mysql_fetch_assoc($getRare))
                            {
                                if ($oe == 2)
                                    {
                                        $oe = 1;
                                    }
                                else
                                    {
                                        $oe = 2;
                                    }
                echo '<table width="107%" style="padding: 5px; margin-left: -15px; background-color: ' . (($oe == 2) ? '#fff' : '#E6E6E6') . ';">
    			<tbody>
    				<tr>
    					<td valign="middle" width="25">
                            <img style="margin-top: -10px;" src="' . $rare['image'] . '">
                        </td>
    					<td valign="top">
                        <b style="font-size: 110%;">' . $rare['name'] . '</b><br />
    						<i>' . $rare['caption'] . '</i><br />
                        Quantité restante: <b>' . $rare['amount'] . '<br />
                        Prix:<b>';
                        if($rare['credits'] >= 1 & $rare['vip_points'] >= 1){
                        echo' '.$rare['credits'].' Crédits + '.$rare['vip_points'].' Coquillages ';
                        }
                        elseif($rare['credits'] >= 1 & $rare['vip_points'] == 0) {
                        echo' '.$rare['credits'].' Crédits ';
                        }
                        elseif($rare['credits'] == 0 & $rare['vip_points'] >= 1) {
                        echo' '.$rare['vip_points'].' Coquillages ';
                        }
                        elseif($rare['credits'] == 0 & $rare['vip_points'] == 0) {
                        echo' Gratuit! ';
                        }
                        echo '</b><br />';
                        if($rare['amount'] >= 1 & $user['credits'] >= $rare['credits'] & $user['vip_points'] >= $rare['vip_points']) {
                        echo '<form method="post"><input type="submit" value="Acheter" name="buy" class="submit" style="float: right;" /></form>';
                        }
                        elseif($rare['amount'] >= 1 & $user['credits'] < $rare['credits']) {
                        echo '<br><b style="float: right;">Pas assez de crédits</b>';
                        }
                        elseif($rare['amount'] >= 1 & $user['vip_points'] < $rare['vip_points']) {
                        echo '<br><b style="float: right;">Pas assez de coquillages</b>';
                        }
                        elseif($rare['amount'] == 0) {
                        echo '<br><b style="float: right;">Plus en stock</b>';
                        }
                        echo '</td>
                    </tr>
                </tbody>
                </table>';
            }
        }
        else
        {
            echo '<i>Il n\'y a aucune vente active pour le moment</i>';
        }
      
    echo '</div>
    	</div> 
    </div> 
    <script type="text/javascript">if (!$(document.body).hasClassName(\'process-template\')) { Rounder.init(); }</script> ';
    
    ?>


    But when I click on the button it does nothing, the script load but it seems to don't execute SQL queries and MUS Commands
    Make sure the button is submit type ;p

  24. #24

    Re: LTD Script [CROSS-COMPATIBLE][PHOENIX]

    Can somebody work on sending MUS on RevCMS? It is pretty pointless without MUS and to use this script.



Advertisement