Reputation: 8121
I am trying to design a form to be used in Joomla to edit page titles when logged in as a front end admin.
I have written the following which lists all the articles on the website :
<h3>Edit Page Titles</h3>
<table border="0" style="text-align:left;">
<tr style="text-align:left;">
<th style="text-align:left;" width="400px" scope="col">ID</th>
<th style="text-align:left;" width="400px" scope="col">Name</th>
<th style="text-align:left;" width="400px" scope="col">Params</th>
<th style="text-align:left;" width="400px" scope="col">Delete</th>
</tr>
<?php
if (JFactory::getUser()->id == 0)
die("Access denied: login required.");
else
{
$today = date("d-m-y");
$result = mysql_query("SELECT * FROM ymeg_menu ORDER BY id")or die(mysql_error());
echo '<tr style="text-align:left;">';
while($row = mysql_fetch_array($result))
{
echo '<td style="text-align:left;">';
echo $row['id'];
echo '</td>';
echo '<td style="text-align:left;">';
echo $row['name'];
echo '</td>';
echo '<td style="text-align:left;">';
echo $row['params'];
echo '</td>';
echo '<td>';
echo '<a href="index.php?option=com_chronoforms&chronoform=DeleteTagsAction&token=';
echo $row['id'];
echo '"style="color:#AD0F02 !important; font-weight:bold !important;">Delete</a>';
echo '</td>';
echo "</tr>";
}
}
?>
</table>
When the script is run, in the params column is listed something similar to the following for each page on the site :
num_leading_articles=1 num_intro_articles=0 num_columns=1 num_links=0 orderby_pri= orderby_sec=order multi_column_order=1 show_pagination=2 show_pagination_results=1 show_feed_link=1 show_noauth=0 show_title=0 link_titles=0 show_intro=1 show_section=0 link_section=0 show_category=0 link_category=0 show_author=1 show_create_date=1 show_modify_date=1 show_item_navigation=0 show_readmore=1 show_vote=0 show_icons=1 show_pdf_icon=1 show_print_icon=1 show_email_icon=1 show_hits=1 feed_summary= fusion_item_subtext= fusion_customimage= fusion_customclass= fusion_columns=1 fusion_distribution=even fusion_dropdown_width=290 fusion_column_widths= fusion_children_group=0 fusion_children_type=menuitems splitmenu_item_subtext= suckerfish_item_subtext= page_title=SOS Direct – Motorcycle Breakdown Cover From The Motorcycle Breakdown Experts show_page_title=0 pageclass_sfx= menu_image=-1 secure=0
The part I am trying to extract is : page_title=SOS Direct – Motorcycle Breakdown Cover From The Motorcycle Breakdown Experts
Does anyone know how to extract the above from the returned results so that in the params column all I would get would be something similar to "SOS Direct – Motorcycle Breakdown Cover From The Motorcycle Breakdown Experts" ?.
Upvotes: 0
Views: 350
Reputation: 3846
Try something like this:
$params = new JParameter( $row['params'] );
$title = $params->get('page_title');
The only parameter in the constructor of JParameter is the INI-data.
Upvotes: 1