Mangos vote system duplicates. menu

User Tag List

Results 1 to 5 of 5
  1. #1
    Braxton's Avatar Member
    Reputation
    1
    Join Date
    Nov 2012
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mangos vote system duplicates.

    I am unsure is this is the correct forum to post about this, but I am trying to fix an issue regarding a mangos voting system. I did not put this into place, so I am unsure of where the original user got it. The only information I can provide is that it references the name Axe. The issue I am having is that when someone votes, it sends duplicates. I vote for a mount it sends two mails to the character and each mail has that same mount. Now, I am familiar with using php and mysql, I am no stranger. The method that is being used though is not something I am used to working with. I am hoping I am not the only one that experienced this issue and am looking for a fix. More so, I would like to know where this came from, is there any documentation regarding it. Who ever wrote this did a very poor job of using php code standards when it comes to commenting with details relating to the functions that are written into it which would be a huge help if the author had included this info.

    I do apologize if either this doesn't make sense or I did not include enough information relating to the script, but this is really all I have to work with at this point. If you require more information and can be specific as to what information you need, I will do my best to look into the files and provide you with what I can. I do thank you in advance for any feedback on the matter.

    Have a good one.

    Mangos vote system duplicates.
  2. #2
    Trebor96's Avatar Private
    Reputation
    1
    Join Date
    Nov 2012
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice, thanks.

  3. #3
    Harambeqt's Avatar Elite User CoreCoins Purchaser
    Reputation
    333
    Join Date
    Mar 2010
    Posts
    1,206
    Thanks G/R
    9/29
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Braxton View Post
    I am unsure is this is the correct forum to post about this, but I am trying to fix an issue regarding a mangos voting system. I did not put this into place, so I am unsure of where the original user got it. The only information I can provide is that it references the name Axe. The issue I am having is that when someone votes, it sends duplicates. I vote for a mount it sends two mails to the character and each mail has that same mount. Now, I am familiar with using php and mysql, I am no stranger. The method that is being used though is not something I am used to working with. I am hoping I am not the only one that experienced this issue and am looking for a fix. More so, I would like to know where this came from, is there any documentation regarding it. Who ever wrote this did a very poor job of using php code standards when it comes to commenting with details relating to the functions that are written into it which would be a huge help if the author had included this info.

    I do apologize if either this doesn't make sense or I did not include enough information relating to the script, but this is really all I have to work with at this point. If you require more information and can be specific as to what information you need, I will do my best to look into the files and provide you with what I can. I do thank you in advance for any feedback on the matter.

    Have a good one.
    Hard to help without having the code infront of me.
    Have a look at https://github.com/Lillecarl/mangos_vote (credits to jesper96 & lillecarl for creating & mangosing it)
    if you are looking for a stand-alone vote system.

    Originally Posted by Trebor96 View Post
    Nice, thanks.
    Awkward post is awkward?
    Support the #1 WoW Emulator:
    http://arcemu.org/
    https://github.com/arcemu/arcemu
    - - -

  4. #4
    Braxton's Avatar Member
    Reputation
    1
    Join Date
    Nov 2012
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AfterDawn, Thank you for your return and yes awkward indeed. Here I have included the page that I am questioning. I hope this helps.
    PHP Code:
    <?php
    /***********************************************************
    *    Sendmail function for MaNGOS
    *    by AXE
    *   this file is required for all cores
    ************************************************************/

    /***********************************************************
    *          GLOBAL FUNCTIONS (required for all cores)
    ************************************************************/
    function sendmail($playername,$playerguid$subject$text$item$shopid=0,  $money=0$realmid='1'//returns, IMPORTANT: do not remove <!-- success --> if success
    {
        global 
    $server,$ra_user,$ra_pass,$db,$a_user,$se_c,$realm;
        
    $playername clean_string($playername);
        
    $subject preg_replace"/[^A-Za-z0-9]/"""clean_string($subject)); //no whitespaces
        
    $item preg_replace"/[^0-9]/"""$item); //item id
        
    $realmid preg_replace"/[^0-9]/"""$realmid); //item id
        
    if ($item<>''$item " ".$item;
        
    $text clean_string($text);
        
    $moneypreg_replace"/[^0-9]/"""$money);
        

        
    $telnet fsockopen($server$realm[$realmid]['port_ra'], $error$error_str3);
        if(
    $telnet)
        {
            
    fgets($telnet,1024); // Motd
            
    fputs($telnet$ra_user."\n");
            
            
    sleep(3);
            
            
    //fgets($telnet,1024); // PASS
            
    fputs($telnet$ra_pass."\n");
            
            
    sleep(3);
            
            
    $remote_login fgets($telnet,1024);
            if(
    strstr($remote_login"Logged in."))
            {
                if (
    $item<>'' && $item<>'0')//send item
                
    {
                    
    //sendmail to RA console
                    
    fputs($telnet".send items ".$playername." \"".$subject."\" \"".$text."\"".$item."\n");
                    
    $easf=time();
                    
    $mailtext="Mail with item sent! No money was sent.";
                }
                elseif (
    $money>'0' && $money<>'')//send money
                
    {
                    
    fputs($telnet".send money ".$playername." \"".$subject."\" \"".$text."\" ".$money."\n");
                    
    $moneytext="Mail with money sent! No item was sent.";
                }
                else 
    //send letter
                
    {
                    
    fputs($telnet".send mail ".$playername." \"".$subject."\" \"".$text."\"\n");
                    
    $moneytext="Normal Mail sent!";
                }
                
    //check database if actuall item is there
                //WebsiteVoteShopREFXXXXXXX ->this is unique
                
    $check=$db->query("SELECT * FROM mail WHERE receiver = '".$playerguid."' AND subject ='".$subject."' ORDER BY id ASC  LIMIT 1")or die(mysql_error());
                if(
    mysql_num_rows($check)=='0')
                    
    $status="Recheck script (just to make sure mail is actually sent):<br><br><center><iframe style='width:96%;  height:100px' src='./include/core/mangos_iframe_mailcheck.php?shopid=".$shopid."&reciver=".$playerguid."&subject=".$subject."&realmid=".$realmid."&shash=".sha1($a_user['id'].$playerguid.$subject.$se_c.$shopid)."'><a href='./include/core/mangos_iframe_mailcheck.php?shopid=".$shopid."&reciver=".$playerguid."&subject=".$subject."&realmid=".$realmid."&shash=".sha1($a_user['id'].$playerguid.$subject.$se_c.$shopid)."'>Check here if your mail is here.</a></iframe></center>";
                    
                return  
    "<!-- success --><span class=\"colorgood\">".$mailtext.$moneytext."<br></span><br>".$status;
            }
            else
                return  
    "<span class=\"colorbad\">Remote Login Problem: ".$remote_login."</span><br>Used login: ".$ra_user;
            
            
            
    fclose($telnet);
        }
        else
            return  
    "<span class=\"colorbad\">MaNGOS server is offline, you must do this when server is online.</span>";
    }

    /*************************************************************
    *         NON GLOBAL FUNCTIONS (not required for other cores)
    **************************************************************/
    function clean_string($string//returns
    {
        return 
    str_replace(array("\n""\""), ""$string);
    }

    function 
    test_ra_connection() //used in htdocs/telnet-test.php, echoes
    {
        global 
    $server,$ra_user,$ra_pass,$realm;
        
    $telnet fsockopen($server$realm['1']['port_ra'], $error$error_str3);
        if(
    $telnet)
        {
            
    fgets($telnet,1024); // Motd
            
    fputs($telnet$ra_user."\n");
            
            
    sleep(3);
            
            
    //fgets($telnet,1024); // PASS
            
    fputs($telnet$ra_pass."\n");
            
            
    sleep(3);
            
            
    $remote_login fgets($telnet,1024);
            if(
    strstr($remote_login"Logged in."))
            {
                
    //sendmail to RA console
                
    echo "<font color=\"lime\">Remote connection to MaNGOS console on RealmID:1 is successful</font><br>";
            }
            else
                echo  
    "<font color=\"red\">Remote Login Problem: <i>".$remote_login."</i></font><br>";
                
            
    fclose($telnet);
        }
        else
            echo  
    "<font color=\"red\">Telnet Connection Problem: <i>".$error_str."</i></font><br>";
    }
    function 
    sendmail_confirm($receiver,$subject,$realmid)//returns
    {    
        global 
    $db,$realm;
        
        
    $i=1;
        while (
    $i<=count($realm))
        {
            if (
    $realmid==$i)
            {
                
    $db->select_db($realm[$i]['db']);
            }
        
            
    $i++;
        }
        
        
    $check=$db->query("SELECT id FROM mail WHERE receiver = '".$receiver."' AND subject ='".$subject."' LIMIT 1")or die(mysql_error());
        if(
    mysql_num_rows($check)=='0')
        {
            return 
    "Checking for mail in DB... <font color='orange'>Not found!</font>";//you can change this text
        
    }
        else
            return 
    "Checking for mail in DB... <font color='lime'>Item is successfully sent!</font>";//do not change text or 'recheck' script will not work
    }

  5. #5
    Braxton's Avatar Member
    Reputation
    1
    Join Date
    Nov 2012
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had attempted to write a completely new file to send mail via a mysql query, however the mail row looks like any other yet the item is not in the mail. Seems more of a core issue I assume. Can anyone explain this?

Similar Threads

  1. Mangos Vote Reward System (Must Work)
    By Tomatsuppen in forum WoW EMU Questions & Requests
    Replies: 19
    Last Post: 01-06-2010, 08:00 AM
  2. [Share] Ascent Vote System
    By Greeko in forum WoW EMU General Releases
    Replies: 29
    Last Post: 01-09-2009, 04:51 AM
  3. AVS Help (Ascent Voting System)
    By w21froster in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 07-24-2008, 03:44 PM
  4. Making voting system w/ rewards
    By ledz14 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 06-19-2008, 06:42 PM
  5. Embeded Vote System?
    By Lethi in forum Suggestions
    Replies: 1
    Last Post: 05-02-2007, 04:19 PM
All times are GMT -5. The time now is 08:25 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search