New Webid Banner System 1.2

This new banner system allows users to add there own banners from there user control panel

  1. N3M3SIS

    N3M3SIS Donor Donor

    Joined:
    Oct 12, 2014
    Messages:
    19
    Likes Received:
    2
    nay27uk thanks for your help !!

    now is coming this

    Parse error: syntax error, unexpected '';' (T_CONSTANT_ENCAPSED_STRING) in /var/www/virtual/url.com/webid/htdocs/admin/userbanners.php on line 99

    // Update database
    $query = "INSERT INTO " . $DBPrefix . "banners VALUES
    (NULL, '" . mysql_real_escape_string($_FILES['bannerfile']['name']) . "',
    '" . $FILETYPE . "', 0, 0, '" . $_POST['url'] . "',
    '" . mysql_real_escape_string($_POST['sponsortext']) . "', '" . mysql_real_escape_string($_POST['alt']) . "',
    '" . intval($_POST['purchased']) . ", " . $imagewidth . ", " . $imageheight . ", " . $id . ", ".$seller.")"';
    $system->check_mysql(mysql_query($query), $query, __LINE__, __FILE__);
    $ID = mysql_insert_id();

    // Handle filters
    if (isset($_POST['category']) && is_array($_POST['category']))
    {
    foreach ($_POST['category'] as $k => $v)
    {
    $query = "INSERT INTO " . $DBPrefix . "bannerscategories VALUES (" . $ID . ", " . $v . ")";
    $system->check_mysql(mysql_query($query), $query, __LINE__, __FILE__);
    }
    }
     
  2. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,573
    Likes Received:
    549
    Yeah thought it may do.

    Try this instead mate, sorry but my knowledge of php and SQL is limited.

    New code
    PHP:
    // Update database
    $query "INSERT INTO " $DBPrefix "banners VALUES
    (NULL, '" 
    mysql_real_escape_string($_FILES['bannerfile']['name']) . "',
    '" 
    $FILETYPE "', 0, 0, '" $_POST['url'] . "',
    '" 
    mysql_real_escape_string($_POST['sponsortext']) . "', '" mysql_real_escape_string($_POST['alt']) . "',
    '" 
    intval($_POST['purchased']) . "', " $imagewidth ", " $imageheight ", " $id ", ".$seller.")";
    $system->check_mysql(mysql_query($query), $query__LINE____FILE__);
    $ID mysql_insert_id();
    If that dont work the last one we can try is this
    PHP:
    // Update database
    $query "INSERT INTO " $DBPrefix "banners VALUES
    (NULL, '" 
    mysql_real_escape_string($_FILES['bannerfile']['name']) . "',
    '" 
    $FILETYPE "', 0, 0, '" $_POST['url'] . "',
    '" 
    mysql_real_escape_string($_POST['sponsortext']) . "', '" mysql_real_escape_string($_POST['alt']) . "',
    '" 
    intval($_POST['purchased']) . "', '" $imagewidth "', '" $imageheight "', '" $id "', '".$seller."')"';
    $system->check_mysql(mysql_query($query), $query, __LINE__, __FILE__);
    $ID = mysql_insert_id();
    If neither do the trick you will need to wait until someone better at PHP and SQL looks at the thread
     
  3. N3M3SIS

    N3M3SIS Donor Donor

    Joined:
    Oct 12, 2014
    Messages:
    19
    Likes Received:
    2
    No its not work :(

    the first Code this error
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 5 page:/var/www/virtual/url.com/webid/htdocs/admin/userbanners.php line:95

    and the second Code
    Parse error: syntax error, unexpected '';' (T_CONSTANT_ENCAPSED_STRING) in /var/www/virtual/url.com/webid/htdocs/admin/userbanners.php on line 99
     
  4. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,573
    Likes Received:
    549
    No sorry then mate but I have no more ideas left, one of the other more PHP savvy members should be able to figure it out
     
  5. athera

    athera Active Member

    Joined:
    Jul 10, 2014
    Messages:
    282
    Likes Received:
    40
    Hi N3M3SIS

    INSERT INTO banners VALUES (NULL, 'pic.jpg', 'jpg', 0, 0, 'http://url.com/active_auctions.php?user_id=1', '!! Action !!', '', 50, 1500, 1000, 7, )

    Seems you are missing the last value there is an extra "," at the end
     
    Last edited: Nov 2, 2014
  6. Obed ABabio

    Obed ABabio New Member

    Joined:
    Jul 9, 2018
    Messages:
    3
    Likes Received:
    0
    can this work on 1.2.1
     

Share This Page