Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4]

Author Topic: [TESTING] Template Mod v2 Multiple Layouts dB driven  (Read 10578 times)

centered

  • Guest
Re: [WIP] Template Mod v2
« Reply #45 on: February 07, 2008, 12:49:53 PM »

hmm I have an idea.... add a name to the option value... comma delimiter, then explode it!
Code: [Select]
function t_select($name,$tempID) {
echo ' <select name="strucID[]">';
$tempresult = mysql_query("SELECT id,name FROM ".db('prefix')."templates ORDER BY id ASC");
while ($t = mysql_fetch_array($tempresult)) {
echo '<option value="'.$name.','.$t['id'].'"';
if ($t['id'] == $tempID) { echo ' selected="selected"'; }
echo '>'.$t['name'].'</option>';
}
echo '</select>';
}

....
$dresult = mysql_query($dquery);
while ($d = mysql_fetch_array($dresult)) {
echo '<p>'.$d['name'];
t_select($d['name'],$d['templateid']);
echo '</p>';
}
.....

Down in processing:
Code: [Select]
$strucID = $_POST['strucID'];
and further:
Code: [Select]
switch ($task) {
// v2
// in testing
case 'save_structure':
if (isset($_POST['save'])) {
// test code!!!
$home = explode(',',$strucID['0']);
$itemName = $home['0'];
$templateID = $home['1'];
echo $itemName.'/'.$templateID;

mysql_query("UPDATE ".db('prefix')."tempAssoc SET templateid = '$templateID' WHERE name = '$itemName';");
echo notification(0,'','structure');
}
break;

$home['0'] gives me the itemName needed $home['1'] gives me the new templateid needed....

.. which works BTW!!

BUT!!!

Now how to get that in a foreach statement with an incremental value....?!?!?!?!?!?


EDIT ------------------

I have a feeling it may be close to :
Code: [Select]
0, Incremental value
foreach ($strucID as $id) {
$newID = explode(',',$id[$incremental_value]);
$itemName = $newID['0'];
$templateID = $newID['1'];
}
mysql_query("UPDATE ".db('prefix')."tempAssoc SET templateid = '$templateID' WHERE name = '$itemName';");
« Last Edit: February 07, 2008, 01:42:49 PM by equilni »
Logged

centered

  • Guest
Re: [WIP] Template Mod v2
« Reply #46 on: February 07, 2008, 06:21:06 PM »

got it working!!

Now to fix some bugs... expect a beta this weekend hopefully.  I am getting a new computer tommorow, hence the delay...
« Last Edit: February 07, 2008, 06:46:11 PM by equilni »
Logged

centered

  • Guest
Re: [TESTING] Template Mod v2 Multiple Layouts
« Reply #47 on: February 08, 2008, 12:45:56 AM »

Updated first post Beta release

More teasers:

http://img218.imageshack.us/img218/3825/cateditdr4.jpg


http://img352.imageshack.us/img352/3913/templateviewme4.jpg
This is to fix Fred's 'bug' of selecting no stylesheet
« Last Edit: February 08, 2008, 01:27:53 PM by equilni »
Logged

Edgardo

  • Newbie
  • *
  • Karma: 1
  • Posts: 22
Re: [TESTING] Template Mod v2 Multiple Layouts dB driven
« Reply #48 on: August 02, 2012, 05:25:55 AM »

Hi, and wooow, terrific, grate, dont know what to sead, Is working? Just read the entire post and .. was looking for a way to test thigs and templates and css, Im new on this, and is been dificult to find a good looking site, and also some mods dont get as nice as I spect, this is what Im looking for, so where sould i start?, the only thing is this looks like the never ending story, jja ;D
Logged
Pages: 1 2 3 [4]