[PHP] Simple add badge in to external_flash_texts.txt [PHX]

Results 1 to 9 of 9
  1. #1
    Apprentice Mertphp is offline
    MemberRank
    Oct 2013 Join Date
    7Posts

    smile [PHP] Simple add badge in to external_flash_texts.txt [PHX]

    Hello Ragezone

    If you upload a badge in your folder you wont open external_flash_texts.txt to add badge description because you are to lazy i found an great idea from my lovely friend

    Screen:
    1: http://prntscr.com/4zvgmy
    2: http://prntscr.com/4zvgx5

    PHP Code:
    <?php$badgename htmlspecialchars($_POST['badgename']);$badgedesc htmlspecialchars($_POST['badgedesc']);if(empty($badgename)) {     $error_title "<font color='red'>(Badge name not found)</font>";}elseif(empty($badgedesc)) {    $error_desc "<font color='red'>(Badge description not found)</font>";}else{$succes "Badge name and description added";$myFile "../r63/external_flash_texts.txt";$fh fopen($myFile'a') or die("File not found.");$string "badge_desc_".$badgename."=".$badgedesc."";fwrite($fhnl2br($string). "\r\n");fclose($fh);}?><form method="post">
    Badge name <?php if(isset($error_title)) { echo $error_title; }?></br><input id="name" name="badgename"></br>
    Badge description <?php if(isset($error_desc)) { echo $error_desc; }?></br><input id="name" name="badgedesc"></br>
    <input type="submit" name="submit" value="Submit">
    credits
    Myself to make it simple


  2. #2
    Still alive. Luminia is offline
    MemberRank
    Apr 2013 Join Date
    Out of SpaceLocation
    1,146Posts

    Re: [PHP] Simple add badge in to external_flash_texts.txt [PHX]

    cool idea, thanks!

    Greetz,

  3. #3
    Proficient Member rockster34 is offline
    MemberRank
    Jan 2013 Join Date
    MarsLocation
    167Posts

    Re: [PHP] Simple add badge in to external_flash_texts.txt [PHX]

    Only not every body uses the Folder ../R63/blablabla you know what im saying mabye is it an idea to put there Folder location here


    Sorry for bad english im dutch

  4. #4
    Member DJGOMEZV is offline
    MemberRank
    Mar 2013 Join Date
    56Posts

    Re: [PHP] Simple add badge in to external_flash_texts.txt [PHX]

    Here already running Badge_name:
    PHP Code:
    <?php
    error_reporting
    (E_ALL E_NOTICE);
    $badgename htmlspecialchars($_POST['badgename']);
    $badgedesc htmlspecialchars($_POST['badgedesc']);
    if(empty(
    $badgename)) {     
    $error_title "<font color='red'>(Badgename Found)</font>";
    }
    elseif(empty(
    $badgedesc)) 
    {    
    $error_desc "<font color='red'>(Badge description not found)</font>";
    }else{
    $succes "Badge name and description added";
    $myFile "./swf/gamedata/external_flash_texts/1.txt";
    $fh fopen($myFile'a') or die("File not found.");
    $strings "badge_name_".$badgename."=".$badgename."";
    $string "badge_desc_".$badgename."=".$badgedesc."";
    fwrite($fh"\r" .nl2br($strings). "\r\n" .nl2br($string));
    fclose($fh);
    }
    ?>
    <form method="post">
    Badge name <?php if(isset($error_title)) { echo $error_title; }?></br><input id="name" name="badgename"></br>
    Badge description <?php if(isset($error_desc)) { echo $error_desc; }?></br><input id="name" name="badgedesc"></br>
    <input type="submit" name="submit" value="Submit">

  5. #5
    Member Abidas is offline
    MemberRank
    Mar 2014 Join Date
    DenmarkLocation
    51Posts

    Re: [PHP] Simple add badge in to external_flash_texts.txt [PHX]

    Nice idea! :)

  6. #6
    iiiiiiiiiii Brought is offline
    MemberRank
    Aug 2013 Join Date
    469Posts

    Re: [PHP] Simple add badge in to external_flash_texts.txt [PHX]

    Quote Originally Posted by rockster34 View Post
    Only not every body uses the Folder ../R63/blablabla you know what im saying mabye is it an idea to put there Folder location here
    Sorry for bad english im dutch
    So edit it accordingly to where your texts are located.


    On topic: Great release! Definitely is handy.

  7. #7
    Proficient Member retrostudios is offline
    MemberRank
    Apr 2013 Join Date
    158Posts

    Re: [PHP] Simple add badge in to external_flash_texts.txt [PHX]

    Now make a uploader just for that location etc

  8. #8
    Legend donszeh is offline
    MemberRank
    Jul 2008 Join Date
    DutchLocation
    422Posts

    Re: [PHP] Simple add badge in to external_flash_texts.txt [PHX]

    Good job! Keep up the great work.

  9. #9
    [PHP] Simple add badge in to external_flash_texts.txt [PHX][PHP] Simple add badge in to external_flash_texts.txt [PHX] pel is offline
    MemberRank
    Jan 2012 Join Date
    Munich, GermanyLocation
    384Posts

    Re: [PHP] Simple add badge in to external_flash_texts.txt [PHX]

    Already coded something like that, but my problem was, that I've to switch the ftp server. So I worked with MySQL <: its much better xD



Advertisement