Jump to content

Recommended Posts

Posted (edited)

Why can't we keep this?  I use this to embed a ton of things on pages.  Whether custom PHP driven elements... to dynamic blocks that adapt to the user (based on non-forum items)... to changing visual elements based on mobile vs. desktop... endless list.

Edited by Fast Lane!
Posted

You can, but you would have to add them to an application using widgets, rather than manually adding PHP blocks via the admin CP.

The reality is, some things have been actively removed from being able to be simply added by choice. In this instance, its less use of eval, which can be a security risk and is also quite slow. Other things are simply because it causes breaking changes, or prevents us every updating certain areas without breaking peoples sites. 

Posted (edited)

Will we be able to create custom blocks that contain HTML logic code?  We use it to deliver Google AdManager adverts.  Here are  examples:

<div class='ipsResponsive_showPhone ipsResponsive_block'>
  <p>
      &nbsp;
  </p>
</div>
<div style="display:block; margin:auto; background-color:#D3D3D3; width:308px; box-shadow: 0 0 5px #888; padding:4px;">
  {advertisement="FORUM300x250A"}
</div>
 

{{if request.app == 'forums' and request.do == 'add'}}
  <div style="background-color:#D3D3D3; width:308px; box-shadow: 0 0 5px #888; padding:4px;">
    {advertisement="FORUM300x250C"}
  </div>
{{endif}}
 

Edited by DolSch
added 2nd example
Posted
12 hours ago, DolSch said:

Will we be able to create custom blocks that contain HTML logic code?  We use it to deliver Google AdManager adverts.  Here are  examples:

<div class='ipsResponsive_showPhone ipsResponsive_block'>
  <p>
      &nbsp;
  </p>
</div>
<div style="display:block; margin:auto; background-color:#D3D3D3; width:308px; box-shadow: 0 0 5px #888; padding:4px;">
  {advertisement="FORUM300x250A"}
</div>
 

{{if request.app == 'forums' and request.do == 'add'}}
  <div style="background-color:#D3D3D3; width:308px; box-shadow: 0 0 5px #888; padding:4px;">
    {advertisement="FORUM300x250C"}
  </div>
{{endif}}
 

Yes, the "Manual HTML" option is still present, which you can use with template logic

Posted

Some use cases we use that should help me understand what is possible.  We have 50-100 blocks that fall into one of these categories...

1). We use a php command to import html into an IPB block (for us, we use an external php script to generate different html content throughout the day via a cronjob... dumping to a flat file).  Example in a custom php block:

readfile("/home/m/public_html/tools/popular_topics.txt");

2) Can we execute php in a block to tailor what is shown to a user based on information from a non-IPB database?  Example:

$member_id = '';
if(isset($_COOKIE["mm2_member_id"])) {
	$member_id = (int) $_COOKIE["mm2_member_id"]; 
	}
	
if ($member_id != 0 && $member_id != '') {

  //check a different non-IPB database to pull in data about a user, based on their common member_id

  // Depending on returned value, show different things to the user

}
	

3) Can we execute full php code in a block (catch all question)?  Seems no?  We have soo many use cases here....

Posted
On 12/5/2024 at 9:15 PM, Fast Lane! said:

Some use cases we use that should help me understand what is possible.  We have 50-100 blocks that fall into one of these categories...

1). We use a php command to import html into an IPB block (for us, we use an external php script to generate different html content throughout the day via a cronjob... dumping to a flat file).  Example in a custom php block:

readfile("/home/m/public_html/tools/popular_topics.txt");

2) Can we execute php in a block to tailor what is shown to a user based on information from a non-IPB database?  Example:

$member_id = '';
if(isset($_COOKIE["mm2_member_id"])) {
	$member_id = (int) $_COOKIE["mm2_member_id"]; 
	}
	
if ($member_id != 0 && $member_id != '') {

  //check a different non-IPB database to pull in data about a user, based on their common member_id

  // Depending on returned value, show different things to the user

}
	

3) Can we execute full php code in a block (catch all question)?  Seems no?  We have soo many use cases here....

I have exactly the same thing as you. On my side, it is not up to the forum to generate this special data.
Eventually, the PHP code could be replaced by a wget in javascript (if the URL is not sensitive), not yet tested.

With the removal of custom PHP, editing of post source code and custom ad placements, I will not be migrating to IPS 5...

Posted
On 12/7/2024 at 1:50 AM, ASIKOO said:

I have exactly the same thing as you. On my side, it is not up to the forum to generate this special data.
Eventually, the PHP code could be replaced by a wget in javascript (if the URL is not sensitive), not yet tested.

With the removal of custom PHP, editing of post source code and custom ad placements, I will not be migrating to IPS 5...

How limited are the ad placement options now?  I can’t insert code into templates anymore?  We even have conditional code to do things like add ads after the 1st and 7th post… etc.

What about adding code to the page header?  Example for AdManager and preview there is tons of code that must be there in addition to the ads themselves.  
 

 

Should these new limits stand to reduce income generated by our forums — that feels like a golden goose that should not be touched.  

Posted
15 hours ago, Fast Lane! said:

How limited are the ad placement options now?  I can’t insert code into templates anymore?  We even have conditional code to do things like add ads after the 1st and 7th post… etc.

This can now be done without a line of code.

image.png

 

15 hours ago, Fast Lane! said:

What about adding code to the page header?  Example for AdManager and preview there is tons of code that must be there in addition to the ads themselves.

You can actually add this within Integrations->Google Tag Manager as that is loaded in the head section

15 hours ago, Fast Lane! said:

Should these new limits stand to reduce income generated by our forums — that feels like a golden goose that should not be touched.  

Its always worth asking first 🙂 We certainly haven't done these things to make peoples lives impossible. Many of these things are done to speed up the generation of content on your site, or to improve the software stability. 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...