Jump to content


  • Posts

  • Joined

  • Last visited


Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Surrey, UK

the_oliver's Achievements

Regular Member

Regular Member (3/5)



  1. Hi, I have written the following procedure: DELIMITER $$ DROP PROCEDURE IF EXISTS countInstructors$$ CREATE PROCEDURE countInstructors() BEGIN DECLARE done INT DEFAULT 0; DECLARE a INT; DECLARE cur1 CURSOR FOR SELECT country_id FROM country; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; OPEN cur1; read_loop: LOOP FETCH cur1 INTO a; IF done THEN LEAVE read_loop; END IF; SELECT count(*) FROM instructors WHERE country_id = a; END LOOP; CLOSE cur1; END$$ DELIMITER ; However i only get 1 row returned. What i'm trying to do is to get a row returned for each time the query in the loop is run (SELECT count(*)...). How would i go about doing this? Or am I barking up the wrong tree? Also i get an error about the last line (DELIMITER telling me to check my syntax. Could anyone give me a pointer there too please? Many thanks, - Oliver
  2. Hello, I would like to be able to use the following to secure a 777 file a little: <FilesMatch "\.(inc|php)$"> deny from all </FilesMatch> <FilesMatch "\.(inc|htm)$"> deny from all </FilesMatch> <FilesMatch "\.(inc|html)$"> deny from all </FilesMatch> I don't want to have to put the .htaccess file in the 777 folder as it would defeat the purpose a little. How would i go about changing the FileMatch pattern to be acting on a different directory? Thank you!
  3. Hi, I need to be able to call a class based on variables. E.G. I would normally do: $action = new pattern1() but i would like to be able to do it dynamicaly: $patNum = 1; $action = new pattern.$patNum.() Im wondering if that's possible? If so what would the correct syntax be? Many Thanks.
  4. Hi, Im wondering if there is an easy way to get items out of an array returned by a function inside a class. A code example would be: class modDB { public function getPwdSalt() { $arr = array("salt", "password"); return $arr; } } ?> And what i would like to be able to do is something like: $modDB = new modDB; echo $modDB->getPwdSalt()->[1]; and just get returned 'password'. Is something like that possible? Many Thanks.
  5. Hi There, Im using preg_match and preg_replace with the following expression: /\b".$keyword."\b/i" The problem i'm having is that if $keyword was belt, although 'blackbelt' would not mach (good) and 'belt' would match '<a href="">belt</a>' would also match. What i need is for no part of '<a href="">belt</a>' to match. Any suggestions would be much appreciated! Many thanks.
  6. I've now got it working, but not in IE. Any thoughts on that people? #SideBannerAdd { color: #000; vertical-align: middle; float:right; background: #fff; position: absolute; right: -122px; top: 150px; padding-top: 2px; padding-bottom: 18px; padding-right: 15px; padding-left: 15px; -moz-border-radius: 12px; -khtml-border-radius: 12px; -webkit-border-radius: 12px; -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); } Thanks.
  7. Oh dear, back again. So I now have the div in the right place, and mostly styled. The css is: #SideBannerAdd { color: #000; float:right; background: #fff; position: relative; z-index: -1; right: 5px; height: 40px; top: 80px; -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); -moz-border-radius: 5px; -khtml-border-radius: 5px; -webkit-border-radius: 5px; } But I have two new problems. The first is that if i add more then 4 characters, the menu drops right down on the left, and the blue extends out over the right of the white box. The second is that the text is pushed up against the right of the box (the top if it was the right way up), not in the centre of it. Any more thoughts would be much apreciated. Many Thanks.
  8. Nailed it with margin: 0 auto; Thanks for your pointer seanlim!
  9. It's better now, i've rapped the whole lot in another div and given it a fixed width. Now all i need to do is align the new div centrally. Is there an easy way to do that? Thanks.
  10. Ok, so it's before <div id="canvas"> at the moment. Which puts it in a better place, but i need to lock it to the side of the white area. - Currently it's locked against the right of the browser. I also tried putting it just after <div id="canvas"> but that really messed things up. The menu dropped down a long way, and the blue extended over the right of the white. Thanks.
  11. Hi Seanlim, Thanks, thats there now, but it's just sitting bellow the area. (white 'text' at the bottom of the page). Any more thoughts? Thanks!
  12. Hello, I'm having a problem with this site: http://bit.ly/czTzhd At present everything sits nicely in the centre and stays central as the window size changes. What i'm trying to do though is to get another div (a tab) to appear on the right hand side of the central area (the white block), but leaving the current area central still. I tried warping everything thats there at the moment in a div, and then putting the tab into another div and using z-index but it would only ever appear bellow the current area. Any pointer please? Many Thanks!
  13. Hi onlyican, add_filter() is a word press hook that calls the function. It passes the content of the page being requested by a user, through the specified function. - In this case in_this_instance(). It passes the variable $data to the function, containing all the page content. The content then has to be returned, hence i am doing "return $data;" regardless of the out come. All i want to achieve with this function is to determine weather a string ($rep_val) is present in $data and, if it is, return true as "$in_this_instance". The return form the function has remain the same as what was originally passed to it. @ProjectFear. - Thanks for that, i have placed the "$in_this_instance = 'true';" above the return but the result is still not available out side the function. ($in_this_instance remains as false.) If i put an echo in just before each return, (just to debug), it shows that the "$test = strpos($ ...." bit is working. Ta!
  14. I still havant found any resion for this! Any ideas would be much appreciated!
  15. Perhaps this code makes more sense and will be more helpful! $in_this_instance = 'false'; function in_this_instance($data) { global $in_this_instance; $rep_val = '[front banner]'; $test = strpos($data, $rep_val); if ($test === false) { return $data; } else { return $data; $in_this_instance = 'true'; } } add_filter('the_content', 'in_this_instance'); echo $in_this_instance;
  • 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.