Recent Topics

1 Feb 10, 2009 07:38    

My b2evolution Version: 2.x

Hello.

Is there an existing method to extract data from T_widget 'wi_params' field even when the current blog is not the data trying to be extracted from this table?

Thanks in advance.

2 Feb 10, 2009 09:03

<?php
$sql = 'SELECT wi_params FROM T_widget WHERE wi_coll_ID=##'; // change ## for the blog ID
if( $results = $DB->get_results( $sql ) )
{
  foreach( $results as $result )
  {
     pre_dump( unserialize( $result->wi_params );
  }
}
?>

¥

3 Feb 10, 2009 13:03

Thanks ¥åßßå.

I'm pooping out here as morning is now here and a brain cramp has set in.

I added to the foreach in your reply the following:

$new_array[] = $result->wi_params;

After the completion of the 'foreach' to view the contents, I added:

print_r($new_array[12]);

The output is:

a:6:{s:5:"title";s:8:"Linkblog";s:11:"linkblog_ID";s:0:"";s:14:"linkblog_limit";s:3:"100";s:11:"widget_name";s:8:"Linkblog";s:16:"widget_css_class";s:0:"";s:9:"widget_ID";s:0:"";}

What is the syntax to extract, say the 'title' element value of 'Linkblog' from the '$new_array[12]' element output above?

Thanks again.

4 Feb 10, 2009 15:02

You missed the "unserialize" ;)

¥

5 Feb 10, 2009 20:43

Got it!

Thanks ¥åßßå.


Form is loading...