Gayner Posted August 29, 2009 Share Posted August 29, 2009 Thorne gave me a wonderful script and it works fine but I want to beable to put it inside this function: function BSettings($member){ global $ibforums; return <<<EOF RIGHT IN HERE... EOF; } THIS ^^^ IS MY Skin_UCP.php But only 1 Problem, lol See the function BSettings Resembles: I took out some html so it's not as crowded. This is the script thorne gave me it's epic. $options = array('24-7GT Default', 'Light Blue', 'Sunset', 'Beautiful Blue', 'Tan', 'Crazy Gray', 'Toxin'); $this->output .= "<select name='monkskin'>"; for ($i=0;$i<=6;$i++) { if ($member['monkskin'] == $i) { $this->output .= "<option value='$i' selected='selected'>{$options[$i]}</option>"; } else { $this->output .= "<option value='$i'>{$options[$i]}</option>"; } } $this->output .= "</select>"; But it will not work inside that function because It only allows HTML. How the hell do I get it in there.. function BSettings(){ global $ibforums, $DB, $std, $print; // Lets get your data $DB->query("SELECT mp3access, mp3auto, trans, auto, mp3, desktopi, bcolor, bposition, rep, trans,sigtrans,mstyle,monkskin FROM ibf_members WHERE id='".$this->member['id']."'"); $member = $DB->fetch_row(); $this->output .= $this->html->BSettings($member,$mp3); $this->page_title = $ibforums->lang['t_welcome']; $this->nav = array( "<a href='index.php'>24-7GT Forums</a> -> ", "<a href='index.php?act=UserCP&CODE=01'>Settings</a> -> Background Settings / MP3", ); } That is my USERCP.php page. Link to comment https://forums.phpfreaks.com/topic/172364-this-is-my-real-problem/ Share on other sites More sharing options...
trq Posted August 29, 2009 Share Posted August 29, 2009 Why you needed to open a new thread is beyond me. You should have just asked this question in the first place. I'm sure you'll get the hang of it eventually. function BSettings($member){ global $ibforums; $out = ''; $options = array('24-7GT Default', 'Light Blue', 'Sunset', 'Beautiful Blue', 'Tan', 'Crazy Gray', 'Toxin'); $out = "<select name='monkskin'>"; for ($i=0;$i<=6;$i++) { if ($member['monkskin'] == $i) { $out .= "<option value='$i' selected='selected'>{$options[$i]}</option>"; } else { $out .= "<option value='$i'>{$options[$i]}</option>"; } } $out .= "</select>"; return $out; } Link to comment https://forums.phpfreaks.com/topic/172364-this-is-my-real-problem/#findComment-908800 Share on other sites More sharing options...
Gayner Posted August 29, 2009 Author Share Posted August 29, 2009 Why you needed to open a new thread is beyond me. You should have just asked this question in the first place. I'm sure you'll get the hang of it eventually. function BSettings($member){ global $ibforums; $out = ''; $options = array('24-7GT Default', 'Light Blue', 'Sunset', 'Beautiful Blue', 'Tan', 'Crazy Gray', 'Toxin'); $out = "<select name='monkskin'>"; for ($i=0;$i<=6;$i++) { if ($member['monkskin'] == $i) { $out .= "<option value='$i' selected='selected'>{$options[$i]}</option>"; } else { $out .= "<option value='$i'>{$options[$i]}</option>"; } } $out .= "</select>"; return $out; } TY TY!! But. $out = ''; $options = array('24-7GT Default', 'Light Blue', 'Sunset', 'Beautiful Blue', 'Tan', 'Crazy Gray', 'Toxin'); $out = "<select name='monkskin'>"; for ($i=0;$i<=6;$i++) { if ($member['monkskin'] == $i) { $out .= "<option value='$i' selected='selected'>{$options[$i]}</option>"; } else { $out .= "<option value='$i'>{$options[$i]}</option>"; } } $out .= "</select>"; return $out; <<<EOF Then i lose all my html.. so now my page look like this: LOL Man this is awesome tho... thx a bunch. Anyway I could pertain my html still and show it? lol Link to comment https://forums.phpfreaks.com/topic/172364-this-is-my-real-problem/#findComment-908803 Share on other sites More sharing options...
trq Posted August 29, 2009 Share Posted August 29, 2009 Without understanding how your code works its pretty difficult to give a better example. Link to comment https://forums.phpfreaks.com/topic/172364-this-is-my-real-problem/#findComment-908813 Share on other sites More sharing options...
Gayner Posted August 29, 2009 Author Share Posted August 29, 2009 Without understanding how your code works its pretty difficult to give a better example. I posted all of it man. hmm.. thx man.. iuno what im stuck now lol Link to comment https://forums.phpfreaks.com/topic/172364-this-is-my-real-problem/#findComment-908814 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.