Jump to content

Cosizzle

Members
  • Posts

    210
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.cnicollonline.com

Profile Information

  • Gender
    Not Telling
  • Location
    Canada

Cosizzle's Achievements

Member

Member (2/5)

0

Reputation

  1. Hey guys, Im a little stuck with a JQ script im trying to create. First the html: <div id="image_holder"> <img src="images/default.jpg" id="image_swap" /> </div> <ul id="links" class="test"> <li><a href="#" name="images/01.jpg">Wall-E 2</a></li> <li><a href="#" name="images/02.jpg">Joker 1</a></li> <li><a href="#" name="images/03.jpg">Joker 2</a></li> </ul> What im trying to accomplish is: 1.) When the mouse enters #links I want it to create a bool staying true if it's in there false if it has left. 2.) if the mouse is: 2a) swap the current image loaded out with the new image to be loaded else: 2b.)swap the current image loaded out with the default image. I have several different attempts at this, this script below is a working attempt. But because im referencing the actual "a" attribute, whenever I goto hover on a new link, it will quickly show the default image... jQ('#links li a').hover( function() { var img = jQ(this).attr("name"); var parent = jQ(this).parent().parent().attr("id"); jQ("#image_swap").fadeOut("medium", function() { // if mouse is within the #link id dont show default image if(parent === "links") { jQ(this).attr("src", img); jQ(this).fadeIn("medium"); } // if the mouse is outside the #link id show the default image }) }, function() { jQ("#image_swap").attr("src", "images/default.jpg"); } ); Also as a side note, before asking why im using the "name" attribute to store the URL of the image, it's because the href will be pointed to an actual page.
  2. Just solved my own problem. Turns out that my version of MAMP is running an older version of PHP with this bug. Tested it on a webserver and got a proper result.
  3. Hey guys, I'm having to restore an old database. Within the database are dates formatted as a timestamp for example: 1251308836. I've created a script (see below) to alter this. However I do not get a year. I did some digging around and it sounds like this is a bug? http://bugs.php.net/bug.php?id=49079&edit=1 What do you guys think? $oldDate = 1251308836; echo $oldDate.'<br>'; // output: 1251308836 echo date('d-m-Y',$oldDate); // output: 26-08-0000
  4. So, this is a pretty broad topic - and it's not just for PHP but any language. I find when I get bored stuck, I'll hit the ol'stumble button within firefox and more often than not I come across some logo, or web design inspiational ideas and resources. Currently im working on a complex php project here at work, the dead line is about a week away, of course I'm no where near to where I was hoping to be! (You can run only so many prototypes!! ) While staring at the sticky notes I created to represent class design, and the white board full of paths leading every which way, I found myself a little confused and stumped. Theres lot's of ways one can get inspiration, or get new wheels turning - what is it that helps you guys?
  5. DavidAM, that works out great, thanks kindly!
  6. Yep that works, for now at least - I haven't thought far ahead as to what happens when the information comes back out of the database.
  7. Hey guys, quick background on the project: Im migrating databases and to work in the old with the new. I'm writing a script which takes all the old data manipulates it to my needs then imports it into the database I have setup. Where I'm currently stuck is that there are .txt files that now need to go into the database. However these .txt files contain html. ie.<ul> and <li> tags. Using $var = file('file.txt'); I run into a problem in which the HTML is output. Would there be a way to encapsulate the text file within quotes; or another option? Thanks.
  8. You can put the style within your $message. Something that I've come to do is include a php script. MAIL SCRIPT <?php $to = "xyz@mysite.com"; $subject = "promotion"; include('emailToSend.html'); mail($to, $subject, $message); ?> $body in mail <?php $body = " <html> <head> <style type='text/css'> .style1 { color: #777777; } .style2 { color: #666666; } </style> </head> <body> . '<table width="520" border="0" bordercolor="#FFFFFF">' . ' <tr>' . ' <td width="514" height="90"><p> </p>' . ' <p><span class="style1">Reach out to Community!! </span></p>' . ' <span class="style2">1. Click the mail below.</span><br /><br /> </td>' . ' </tr>' . '</table>'; </body> </html>"; ?> edit: I copied your stuff into the second script... so it wont work because of the quotes but you get the idea...
  9. Ya... writing something so simple as 'helloworld' would take a bit of scripting to do. Don't let this throw you off though! The reason why is because of how information is being passed. You are technically creating an object of 'helloworld' and manipulating that object while protecting it's core data (or private data) You'll need to do some reading, OOP is a complex topic, heck im still learning it after 3 or 4 years of working with it... for starters check out http://www.devarticles.com/c/a/PHP/Object-Oriented-Programming-in-PHP/ or http://www.phpdeveloper.org/news/5719 honestly google is your friend here... Don't get discouraged though, take it in small bites (that what OOP is after all)
  10. First off, I personally feel that working on any type of large project is a great way to learn, developing quick small jobs makes it hard to evaluate your skills, make mistakes and learn from them. Secondly if you had a lot of programming experience you would know a little more about OOP especially if you plan to use PHP5. I don't say this to be mean but Object Oriented Programming is the fundamental for so many of todays well built applications. I suggest you look into class design with OOP! Through out your project be sure to come and ask questions and seek help if it's needed!
  11. Once we've done all that we can start debugging the buttons // if $page is equal to 1 and less than $total pages // show the next button // if $page is greater than 1 and less than $toalpages // show prev button and next button // if $page is equal to $total_pages // disable next button if ($page == 1 && <= $total_pages) { // show next button } if ($page > 1 && <= $total_pages) { // show prev button and next button } if ($page == $total_pages) { // show prev }
  12. Hmm, well lets break it down: // check if the URI is is NOT set. If it;s not, set it to 1, else if it is set - set $page to the URI value. $page = (!isset($_GET['page']))? 1 : $_GET['page']; $prev = ($page - 1); $next = ($page + 1); Next you should debug these messages. echo $page . ' ' . $prev . ' ' . $next; This will show you what page is currently set to. After this lets see a few more variables: echo '$total_results='.$total_results; echo ' $total_pages='.$total_pages;
  13. You need to break this apart and debug it in steps. 1st print your arrays and see what they're showing. echo '<pre>'; print_r($sortedlist); echo '</pre>'; and echo '<pre>'; print_r($entry); echo '</pre>';
  14. Sure it's possible, I would create an array of felids, or questions that need to be asked. I would then after $_POST is sent loop through that array
  15. It defines that IN_PHPBB is set to true. Think of it as a constant. You could later go if (IN_PHPBB == true) { // do something }
×
×
  • 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.