Have pending cards auto-upload?

  1. 3 years ago

    Hello! I want to be able to use Cardsearch on my pending pages so it will be easier for me to obsessively trade with every member in one sitting, as I like to do. Hahaha. I have a problem of accidentally asking for doubles, and since editing my func.php to work like this, it has helped me spot doubles a lot easier. I have pretty much got all of this set up and working.

    My Pending Page | Screencap

    What I would like to be able to do is have it auto upload the cards I will be receiving. Is that possible? Currently I have just been manually doing it.

    Sorry for such a strange request!

    My code is probably a mess, because I do not know any php and I just guessed a lot until it worked, but here is my butchered code, in case it is needed, or someone wants to correct something I did wrong:

    // Show all pending trades. $tcg = the name of the TCG as defined in the database.
    function show_pending($tcg) {
    
    	$database = new Database;
    	
    	$tcginfo = $database->get_assoc("SELECT * FROM `tcgs` WHERE `name`='$tcg' LIMIT 1");
    	$tcgid = $tcginfo['id'];
    	$cardsurl = $tcginfo['cardsurl'];
    	$format = $tcginfo['format'];
    	
    	$result = $database->query("SELECT * FROM `trades` WHERE `tcg`='$tcgid' ORDER BY `date`,`trader`");
    	while ( $row = mysql_fetch_assoc($result) ) {
    		
    		$giving = explode(',',str_replace(';',',',$row['giving']));
    		$receiving = explode(',',str_replace(';',',',$row['receiving']));
    		
    
    		
    		echo '<h5>'.$row['trader'].' ('.date('F d, Y', strtotime($row['date'])).') </h5>';
    		
    		foreach( $receiving  as $card ) {
    		
    			$card = trim($card);
    			echo '<img src="'.$cardsurl.''.$card.'.'.$format.'" alt="" title="'.$card.'" /> ';
    		
    		}
    		
    		echo '<br />';
    		
    		$receiving = str_replace(';',',',$row['receiving']);
    		
    		if ( $receiving !== '' ) { echo ''.$receiving.' <br />'; }
    		
    		echo '<b>for</b><br />';
    		
    
    		
    		$giving = str_replace(';',',',$row['giving']);
    		
    		if ( $giving !== '' ) { echo ''.$giving.' <br />'; }
    		
    		echo '<br /><br />';
    	
    	}
    
    }
  2. Bloo

    14 Dec 2015 Administrator kablooey.net

    Hi Kriss!

    So sorry for the late response! I saw your question a while ago, but was unsure how to respond at the time, lol. ^^; It's definitely possible to have your receiving cards automatically upload, but it's not a very straightforward process and would require modification of the core code base, which I generally don't recommend.

    Do the TCGs you're playing allow you to direct link images? If so, I'd suggest you just change your settings to use their card URLs, and then you wouldn't need to worry about auto-uploading anything at all.

    Alternatively, if all you really want is to be able to search your receiving cards for doubles using the card search script, it might be easier to just modify the script to search the text-based list of receiving cards as well?

    Let me know if either of these options would work for you, and I can help you set it up if needed~

or Sign Up to reply!