Moderators: Dragonrider, J_S, Hernol, vancoovur, H2B2, Heritage
--
-- Table structure for table `phplist_template_permissions`
--
CREATE TABLE `phplist_template_permissions` (
`id` int(11) NOT NULL auto_increment,
`UserID` varchar(12) NOT NULL default '',
`TemplateID` varchar(12) NOT NULL default '',
`TemplateDESC` varchar(50) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=4 ;
--
-- Dumping data for table `phplist_template_permissions`
--
INSERT INTO `phplist_template_permissions` VALUES (1, '2', '1', 'Old Phplist design');
INSERT INTO `phplist_template_permissions` VALUES (2, '2', '2', 'PHPlist');
INSERT INTO `phplist_template_permissions` VALUES (3, '2', '3', 'new template');
#########################
# mod to allow template permissions - 21/03/06
# Mark Bell
#########################
//print the help '?' link and the 'Use Template' label
$formatting_content .= '<td>'.Help("usetemplate").' '.$GLOBALS['I18N']->get("usetemplate").': </td>
<td><select><option>-- '.$GLOBALS['I18N']->get("selectone").'</option>';
//which user is currently logged in?
$UserID = $_SESSION["logindetails"]["id"];
$req = Sql_Query("SELECT TemplateID, TemplateDESC FROM phplist_template_permissions WHERE UserID = '$UserID'");
while ($row = Sql_Fetch_Array($req)) {
$formatting_content .= sprintf('<option>%s</option>',$row["TemplateID"], $row["TemplateID"]==$_POST["template"]?'SELECTED':'',$row["TemplateDESC"]);
}
$formatting_content .= '</select></td></tr>';
}
#########################
# End - 21/03/06
# Mark Bell
#########################
#########################
# mod to allow template permissions - 21/03/06 - 22/11/07
# Mark Bell, Lode Vanoost
#########################
//print the help '?' link and the 'Use Template' label
$formatting_content .= '<tr><td>'.Help("usetemplate").' '.$GLOBALS['I18N']->get("usetemplate").': </td>
<td><select><option>-- '.$GLOBALS['I18N']->get("selectone").'</option>';
//which user is currently logged in?
$UserID = $_SESSION["logindetails"]["id"];a
$req = Sql_Query("SELECT TemplateID, TemplateDESC FROM phplist_template_permissions WHERE UserID = '$UserID'");
while ($row = Sql_Fetch_Array($req))
{
$formatting_content .= sprintf('<option>%s</option>',$row["TemplateID"], $row["TemplateID"]==$_POST["template"]?' SELECTED':'',$row["TemplateDESC"]);
}
$formatting_content .= '</select></td></tr>';
}
#########################
# End - 21/03/06 - 22/11/07
# Mark Bell , Lode Vanoost
#########################
CREATE TABLE `phplist_template_permissions` (
`id` int(11) NOT NULL auto_increment,
`UserID` varchar(12) NOT NULL default '',
`UserRole` int(11) NOT NULL,
`TemplateID` varchar(12) NOT NULL default '',
`TemplateDESC` varchar(50) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT
--
-- Dumping data for table `phplist_template_permissions`
--
INSERT INTO `phplist_template_permissions` VALUES (1, 1, '2', '1', 'Template Name 1');
INSERT INTO `phplist_template_permissions` VALUES (2, 0, '2', '2', 'Template Name 2');
INSERT INTO `phplist_template_permissions` VALUES (3, 0, '2', '3', 'Template Name 3');
$req = Sql_Query("select id,title from {$tables["template"]} order by listorder");
if (Sql_affected_Rows()) {
$formatting_content .= '<tr><td>'.Help("usetemplate").' '.$GLOBALS['I18N']->get("usetemplate").': </td>
<td><select><option>-- '.$GLOBALS['I18N']->get("selectone").'</option>';
$req = Sql_Query("select id,title from {$tables["template"]} order by listorder");
while ($row = Sql_Fetch_Array($req)) {
$formatting_content .= sprintf('<option>%s</option>',$row["id"], $row["id"]==$_POST["template"]?'SELECTED':'',$row["title"]);
}
$formatting_content .= '</select></td></tr>';
}
$req = Sql_Query("select id,title from {$tables["template"]} order by listorder");
if (Sql_affected_Rows()) {
// $formatting_content .= '<tr><td>'.Help("usetemplate").' '.$GLOBALS['I18N']->get("usetemplate").': </td>
// <td><select><option>-- '.$GLOBALS['I18N']->get("selectone").'</option>';
// $req = Sql_Query("select id,title from {$tables["template"]} order by listorder");
// while ($row = Sql_Fetch_Array($req)) {
// $formatting_content .= sprintf('<option>%s</option>',$row["id"], $row["id"]==$_POST["template"]?'SELECTED':'',$row["title"]);
// }
// $formatting_content .= '</select></td></tr>';
// }
#########################
# mod to allow template permissions - 21/03/06 - 22/11/07 - 2/5/08
# Mark Bell, Lode Vanoost, Lisa Jeter
#########################
//print the help '?' link and the 'Use Template' label
$formatting_content .= '<tr><td>'.Help("usetemplate").' '.$GLOBALS['I18N']->get("usetemplate").': </td>
<td><select><option>-- '.$GLOBALS['I18N']->get("selectone").'</option>';
//which user is currently logged in?
$UserID = $_SESSION["logindetails"]["id"];
$role = ($UserID > 1) ? "WHERE UserID = '$UserID'" : "";
$req = Sql_Query("SELECT TemplateID, TemplateDESC FROM phplist_template_permissions $role");
while ($row = Sql_Fetch_Array($req))
{
$formatting_content .= sprintf('<option>%s</option>',$row["TemplateID"], $row["TemplateID"]==$_POST["template"]?' SELECTED':'',$row["TemplateDESC"]);
}
$formatting_content .= '</select></td></tr>';
}
#########################
# End - 21/03/06 - 22/11/07 - 2/5/08
# Mark Bell , Lode Vanoost, Lisa Jeter
#########################
solmar wrote:Is anyone having the same problem?
Return to Add-ons, Contributions, Mods, Plug-ins
Users browsing this forum: No registered users and 0 guests