We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Upgrade to 1.7.1 broke uri parsing code

Development and Programming

Angus K's avatar
Angus K
14 posts
14 years ago
Angus K's avatar Angus K

I have just upgraded to 1.7.1 and the following php to parse the preferences array is now broken. Any ideas?

<?php require_once “./php/config.php”;

//query to get uri’s $q = “SELECT site_pages FROM exp_sites”; $temp = mysql_query($q) or die(‘Query failed:’.mysql_error());

$temp_array = mysql_fetch_assoc($temp); $temp_array2 = unserialize($temp_array[‘site_pages’]);

foreach($temp_array2[‘uris’] as $entry_id => $value) {

if ($entry_id == “{embed:entryid}”) { $value = substr($value, 1); echo $value; } }

?>

Moved to Development and Programming by Moderator

       
silenz's avatar
silenz
1,651 posts
14 years ago
silenz's avatar silenz

Did you upgrade from 1.6.8 or lower? Then take a look here.

       
Angus K's avatar
Angus K
14 posts
14 years ago
Angus K's avatar Angus K

Array structure has changed, I see.

How do I now reference it in the php? Like this?

$temp_array2 = unserialize($temp_array[‘site_pages’][‘site_id’]);

bit stuck!

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
14 years ago
Sue Crocker's avatar Sue Crocker

Thanks for the assist, silenz.

Angus, since this is a coding question, moving to the Development and Programming forum for additional community support.

       
Angus K's avatar
Angus K
14 posts
14 years ago
Angus K's avatar Angus K

It’s

foreach($temp_array2[1][‘uris’] as $entry_id => $value) {

for reference.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.