Go Back   Pligg CMS Forum > Pligg Help > Customization Assistance

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-07-2008, 06:04 PM
New Pligger
Pligg Version: none
Pligg Template: none
 
Join Date: Jan 2008
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
foreach loop problem

Hi guys,

I seem to have hit a brick wall..

I',m modifying (only slightly) the Pligg 9.9.0

I'm storing extra data (array, which is serilzed) in the link_field1 in the DB.

I think retrive the data and display it with each story/link posted.

This is my code (or the bit that doesnt seem to do what it should!)

[link_summary.tpl]
Code:
{if $link_field1 neq ""}
				<b>{$link_field1} </b>
				{php}
				$array = unserialize($link_field1);	
					{/php}
			{foreach from=$array item=entry}
    , <a href="{$entry->category_name}">:-:-:{$entry->category_safe_name}</a>
					{/foreach}
					{/if}
I know $link_field1 is not empty as it prints out something similar to

Code:
a:1:{i:0;O:8:"stdClass":2:{s:18:"category_safe_name";s:9:"MyTestData";s:13:"category_name";s:9:"My Test Data";}}
Which as far as my knowledge is a Serialized array, [containing one object] -

he for loop doesnt seem to be printing out the category_name and category_safe_name

why am I not getting the relvant print out, do i need to clean some cache (I've done this) or something? Could it be a server problem? Maybe a bug in the FrameWork? Could I possible have the wrong version of PHP??

This is all in the tpl file. I know the $link_field1 is fine as it shows data, the database holds the data too. So the only thing I can point to is the serialize method as show above? is that correct? shouldit be like that

Its driving me insane, I've been trying to get to the bottom of this for dayyys!! Huh Huh

Any help would be appreciated

Thanks in advance

Will
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with template in IE7 xsillence General Help 2 08-29-2007 11:30 PM
Weird problem with seeing images SteveF General Help 6 08-12-2007 08:59 AM
upgrading to 9.6 yathosho Installation and Upgrade Help 6 07-08-2007 07:05 AM
Problem form doesn't work! nabil Bug Report 1 04-01-2006 08:53 PM


Search Engine Friendly URLs by vBSEO 3.2.0