Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 201
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 183
Total: 183

Author Topic: Custom PHP code?  (Read 4781 times)

0 Members and 1 Guest are viewing this topic.

Offline kodbg

  • Member
  • *
  • Posts: 11
    • View Profile
Custom PHP code?
« on: February 28, 2011, 04:27:29 am »
I need to add a custom php code:


$banner1Ad[1] = ' ';
$banner1Ad[2] = '<object type="application/x-shockwave-flash" data="http://forum.setcombg.com/climamarket.swf" width="468" height="60"><param name="movie" value="http://forum.setcombg.com/climamarket.swf" /></object>';

$ad1Count = count($banner1Ad);
$random1AdNumber = mt_rand(1, $ad1Count);
echo $banner1Ad[$random1AdNumber];


Simple banner rotator...

When i add this code with checked IS PHP code, i hreceive error - We have detected an error in your syntax for your php ad code

Please, give me a solution?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Custom PHP code?
« Reply #1 on: February 28, 2011, 08:31:23 am »
What SMF version I tested on SMF 1.1.x I did not get a syntax error make sure you are not putting in the starting and ending php tags
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline kodbg

  • Member
  • *
  • Posts: 11
    • View Profile
Re: Custom PHP code?
« Reply #2 on: February 28, 2011, 11:18:15 pm »
My SMF version is 1.1.13

I put exactly this:


Code: [Select]
$banner1Ad[1] = '&nbsp;';
$banner1Ad[2] = '<object type="application/x-shockwave-flash" data="http://forum.setcombg.com/climamarket.swf" width="468" height="60"><param name="movie" value="http://forum.setcombg.com/climamarket.swf" /></object>';

$ad1Count = count($banner1Ad);
$random1AdNumber = mt_rand(1, $ad1Count);
echo $banner1Ad[$random1AdNumber];



So, if i put this:
$banner1Ad[1] = test;
it is ok
But, if i put this:
$banner1Ad[1] = 'test';
i have an error.

The problem is in '  ' ?

PS - I'm done.
In adseller.php i remove:
// Check php syntax
      if ($isphp == 1)
      {
         if (adseller_check_syntax($customadcode) == false)
            fatal_error($txt['seller_txt_syntax_error'],false);
      }
And the form accepts my code.
« Last Edit: March 01, 2011, 12:03:11 am by kodbg »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Custom PHP code?
« Reply #3 on: March 01, 2011, 12:23:55 am »
Does the code work? if you remove that line?
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline kodbg

  • Member
  • *
  • Posts: 11
    • View Profile
Re: Custom PHP code?
« Reply #4 on: March 01, 2011, 01:55:01 am »
Does the code work? if you remove that line?

Yes, it works fine - you can see it - top, right - the banner in user area - http://forum.setcombg.com


There is something wrong with your verification.
You have this code in two places in adseller.php - line 1255 and line 1499
Line 1255 is OK, but line 1499 return error
« Last Edit: March 01, 2011, 02:02:38 am by kodbg »

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
4079 Views
Last post March 23, 2010, 12:25:47 pm
by SMFHacks
4 Replies
5856 Views
Last post April 29, 2010, 08:23:00 pm
by cheers101
3 Replies
3722 Views
Last post February 23, 2011, 06:06:47 pm
by SMFHacks
0 Replies
2519 Views
Last post August 13, 2011, 11:06:39 am
by Andy
14 Replies
7003 Views
Last post February 23, 2013, 12:34:50 pm
by amwebby

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal