Permalinks and parameters on view-list
2 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: March 23, 2018 (RSS)
By incube - March 20, 2018
Hi I have a blog page.
I have something like that :
if(isset($_GET['auteur'])){
$data =$_GET['auteur'];
$where = 'auteur';
};
if(isset($_GET['categorie'])){
$data =$_GET['categorie'];
$where = 'cat_gorie';
};
if($data!=""){
// load records from 'blogue'
list($blogueRecords, $blogueMetaData) = getRecords(array(
'tableName' => 'blogue',
'loadUploads' => true,
'allowSearch' => false,
'where' => $where.'='.$data
));
}else{
// load records from 'blogue'
list($blogueRecords, $blogueMetaData) = getRecords(array(
'tableName' => 'blogue',
'loadUploads' => true,
'allowSearch' => false,
));
}
So normally I can link like that : /blogue.php&auteur=1 or /blogue.php&cat_gorie=1 and it works.
I would like to do the same but with the permalink addon.
I would like to be able to link something like : /blogue/author/nameofauthor and blogue/category/nameofcategory
I already have 1 tables for Authors and category. So I think it would be possible to cross data to get what I need but I don't know how to set that with the permalink pluggin.
Thanks.
By Dave - March 23, 2018
Hi incube,
What you can do is add any extra parameters _after_ the permalink like this:
https://www.interactivetools.com/add-ons/form-generator/?this=123&that=456
Also, be sure to escape your mysql inputs to avoid security issues:
'where' => " $where = '" .mysql_escape($data). "'",
Hope that helps!
interactivetools.com