Jump to content

soltek

Members
  • Posts

    109
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

soltek's Achievements

Member

Member (2/5)

0

Reputation

  1. Hey guys, I'm trying to customize the look of a script, but I'm having issues extracting the output of a string - I think that's a string. This is the the code the function/string: function notice(){ printf($this->lang['notice'],Tools_get::convert_time($this->ttl*60),$this->limitPERIP,Tools_get::convert_time($this->ttl_ip*60)); $this->CheckMBIP(); $MB1IP = Tools_get::convertmb($this->countMBIP*1024*1024); $thislimitMBIP = Tools_get::convertmb($this->limitMBIP*1024*1024); $maxsize = Tools_get::convertmb($this->max_size_other_host*1024*1024); printf($this->lang['yourjobs'],$_SERVER['REMOTE_ADDR'],$this->lookup_ip($_SERVER['REMOTE_ADDR']),$this->max_jobs_per_ip,$MB1IP,$thislimitMBIP); printf($this->lang['status'],$maxsize,count($this->jobs),$this->max_jobs,$this->get_load(),$this->max_load,Tools_get::useronline()); } And this is the code on the footer that display the IP address, maximum jobs and stuff: <?php echo $obj->notice();?> This last line prints everything I need on the page, but I wanted to put them inside <span>s, to I tried to do something like: <span><?php echo <?php echo $config->lang['yourjobs'] ?></span> But it doesn't work. Can you give me hand please?
  2. This is the SQL table: id parent_id name image 1 0 cars 2 1 ford 16 13 Other Bracelets 9 0 Pendants 1333394949.jpg 10 9 Silver Pendants 1333394961.jpg 11 0 Blue Pendants 1333394975.jpg 12 9 Blue Pendants 1333395004.jpg 13 0 Bracelets 1333395054.jpg 14 13 Silver Bracelets 1333395068.jpg 15 13 Children Bracelets 1333395093.jpg Some subcategories aren't visible. Actually only: Ford Silver Bracelets Children Bracelets Silver Pendants Blue Pendants And this only happens after I delete the categories and subcategories from the SQL code you guys gave me. I tried to delete all but one - cars - but that didn't work either.
  3. Hmmm this is weird. I just created the categories table again, using the SQL code you guys shared with me earlier, and the subcategories thingy works properly. I deleted all the rows from that table and added the new categories and subcategories guess what? There were no subcategories on the HTML output. I created the table again using the SQL code, added the new categories and subcategories withougt deleting the categories added using the SQL code and... it works. Any idea what's going on?
  4. Here: Array ( [23] => Array ( [id] => 23 [parent_id] => 0 [name] => Bracelets [image] => 1333296301.jpg ) [27] => Array ( [id] => 27 [parent_id] => 0 [name] => Pendants [image] => 1333296468.jpg ) )
  5. Anyone? I'm using this code <?php $mysqli = new mysqli('localhost', 'root', 'root', 'test'); $query = 'SELECT id, parent_id, name, image FROM categories'; $result = $mysqli->query($query); if ($result->num_rows > 0) { $categories = array(); while($row = $result->fetch_assoc()) { if ($row['parent_id'] != 0) { $categories[$row['parent_id']]['sub'][] = $row; } else { $categories[$row['id']] = $row; } } echo '<ul>'; foreach($categories as $cat) { echo '<li>'; if ($cat['parent_id'] == 0) { echo $cat['name']; } if (isset($cat['sub']) && is_array($cat['sub'])) { echo '<ul>'; foreach($cat['sub'] as $sub) { echo '<li>' . $sub['name'] . '</li>'; } echo '</ul>'; } echo '</li>'; } echo '</ul>'; } else { echo 'There are no categories'; } It kinda works, but the output display no sub-categories, when in should. I think the problem may be in this line: if (isset($cat['sub']) && is_array($cat['sub'])) { [/doce]
  6. I don't get it Where does this: $categories[$row['parent_id']]['sub'][] = $row; comes from -the sub part?
  7. Only up to one level. Each category may have more than one subcategory, but that's it.
  8. Oh okay. Category table: - ID - name - image Subcategory table: -ID -name -image -parent
  9. Hello there, this is a really noob question, but I've no idea on how to make it work without making everything messy and crappy. I have one SQL table called categories, and another called subcategories. Inside the subcategories table there's a field named 'parent' that will link it to the correspondent category, so it should look something like this in html: <ul> <li>Category <ul> <li>Subcategory</li> </ul> </li> </ul> Would you please give this poor guy a hand? =)
  10. Thanks a lot =) Would you please tell me you share a link about what does the '+' sign stands for on this line? $('#'+this.title).show('slow');
  11. Oops, I forgot to say I'd like to do it using Jquery. I kinda know how to use the 'hide' and 'show', but I've no idea about how to display automatically the correspondent element.
  12. Here I am once again, guys =) First, my markup: <div class="items_list"> <span ID="1">Item</span> <span ID="2">Item</span> <span ID="3">Item</span> </div> <div class="content_list"> <div id="1">Content</div> <div id="2">Content</div> <div id="3">Content</div> </div> So, all the divs inside .contant_list are hidden using css, what I'm trying to do is to make them visible, once the correspondent span is clicked. For example, you click on the second span, with ID=1, and the div with the same ID would become visible. Can you help me do that? If this method isn't... suitable, you can suggest me another ones. Thanks!
  13. Hey guys, I've been using JQuery for the last week (amazing stuff) and I've come to a problem. What I did is this: »A page with two buttons, each of them grabs another file from the server and display it on the div bellow. This using the .load function. (just like an old iframe) That .load function loads a table that one has one toggle action. When you click on each row, it would slideDown another div. And here's the problem, everything works fine, the .load and the slideDown, but after loading the content, the slideDown doesn't work anymore. I think the problem is that the loaded page isn't being affected by the JS code contained in the header. As a test I made a simple hide-on-click on that page and that didn't work either. So, my question is, after the page is .load(ed), I can't grab the content from the page where it is being loaded? Thanks!
  14. Hello again, guys! I'm trying to do this: Get $user_ID -> SELECT FROM favorites WHERE user="$user_ID" -> Now I should create an array with the ID of all the results of the previous command -> SELECT FROM books WHERE genre="$favorites_ID" -> populate a html table. The part I've no idea about how to do is building an array with the results and then using the SELECT command, find in the other tables the match. Could you please give me a hand - one more time?
  15. Sorry for being an undertaker, but I dont think my question needs a new topic. So, does this function includes the 'daylight saving time' thing?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.