Jump to content

son.of.the.morning

Members
  • Posts

    292
  • Joined

  • Last visited

    Never

Posts posted by son.of.the.morning

  1. Hey guys,

     

    I really want to start using frameworks to speed up development and i have came across a few inc Zend and Cake. I was wondering if any of you have used them or have alternative recommendations. Also I cant seem to find any decent Zend tutorials does anyone have any links they could post me?

     

     

  2. I have a bit of Jquery that searches in a div for another div with the id "show" then it will remove that class from that div and give the next div in the z-index the same value. My problem is i have a while loop which is repeating the div with the id "show". What i need is for the while loop to display one return with a div with the id of "show" then the rest of the results to be in a div with no id. I have been messing around with this for ages now and am not getting anywere.

  3. I am having a problem here i am trying to make a simple fade slider but the divs which am using have sub divs that want display.

     

    HTML

        <div id="LoopArticles">
        	
            <div class="show">
                <div id="SliderHead">Yo Yo Yo</div>
                <div id="SliderBody">
                Random Random Random Random Random Random Random Random Random Random Random Random Random Random 
                Random Random Random Random Random Random Random Random Random Random Random Random Random Random 
                </div>
            </div>
            
            <div>
                <div id="SliderHead">Yo Yo Yo</div>
                <div id="SliderBody">
                Random Random Random Random Random Random Random Random Random Random Random Random Random Random 
                Random Random Random Random Random Random Random Random Random Random Random Random Random Random 
                </div>
            </div>
    </div>
    

     

    Jquery

    <script type="text/javascript">
    // JavaScript Document
    $(document).ready(function() {		
    
    //Execute the slideShow
    slideShow();
    
    });
    
    function slideShow() {
    
    //Set the opacity of all images to 0
    $('#LoopArticles div').css({opacity: 0.0});
    //Get the first image and display it (set it to full opacity)
    $('#LoopArticles div:first').css({opacity: 1.0});
    //Call the gallery function to run the slideshow, 6000 = change to next image after 6 seconds
    setInterval('gallery()',3000);
    
    }
    
    function gallery() {
    
    //if no IMGs have the show class, grab the first image
    var current = ($('#LoopArticles div.show')?  $('#LoopArticles div.show') : $('#LoopArticles div:first'));
    //Get next image, if it reached the end of the slideshow, rotate it back to the first image
    var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#LoopArticles div:first') :current.next()) : $('#LoopArticles div:first'));	
    
    //Set the fade in effect for the next image, show class has higher z-index
    next.css({opacity: 0.0})
    .addClass('show')
    .animate({opacity: 1.0}, 1000);
    
    //Hide the current image
    current.animate({opacity: 0.0}, 1000)
    .removeClass('show');
    
    }
    </script>

     

    any one have any ideas?

  4. I got on to that a few moments ago and tried the code below... but it still ante having non of it i cant see were am going wrong at all

     

    jQuery(function ($) {
    $('.basic').each(function() {
    	var obj_click = $(this);
    	$('.basic',obj_click).click(function (e) {
    		$('#basic-modal-content').each(function() {
    			var modal = $(this);
    			$('#basic-modal-content',modal).modal();
    
    			return false;
    		});
    	});
    });
    });
    

  5. I am trying to create a each() function to view individual modals in a php while loop.

     

    open modal

    <script type='text/javascript'>
    jQuery(function ($) {
    $('.basic').click(function (e) {
    	$('#basic-modal-content').modal();
    
    	return false;
    });
    });
    </script>
    

    I tried this but it's not working (.record_i looped div container holding the hidden Div (modal) )

    <script type='text/javascript'>
    
    
    	$('.Record_i').each(function() {
    		var obj_modal = $(this);
    		jQuery(function ($) {
    			$('.basic',obj_modal).click(function (e) {
    				$('#basic-modal-content',obj_modal).modal();
    
    				return false;
    			});
    		});
    	});
    
    
    </script>
    

     

    Any ideas?

  6. I tryied what you said but didnt have any luck.

     

    I thought i could use this method, but this also does fuck all!

                <?php
                	$a = "SELECT * FROM blog_posts ORDER BY id DESC LIMIT 2";
    			$query = mysql_query($a) or die (mysql_error());
    			//$query_results = mysql_fetch_array($query);
    			while ($row = mysql_fetch_assoc($query)){
    
    				 $title = $row['title'];
    				 $post = $row['post'];
    				 $img = $row['img'];
    			}
    		?>
    
    

  7. I want to use all five results separately in order to use in a Jquery slider.

     

    <?php
               $a = "SELECT * FROM blog_posts ORDER BY id DESC LIMIT 5";
       $query = mysql_query($a) or die (mysql_error());
               $query_results = mysql_fetch_array($query);
    ?>
    

     

    I know if i was going to grab vars from an normal array i would just use...

     

    <?php echo $array_reults['0'] ?>
    

     

    Can any one help me with this problem?

  8. For some reason my email system isnt working, but no errors are showing up and i cant seem to find a syntax error. I need some fresh eyes to help to solve this...

     

    <?php
    if(isset($_POST['PersonName'])) {
    
    	// EDIT THE 2 LINES BELOW AS REQUIRED
    	$email_to = "j.hopley@2008.ljmu.ac.uk";
    	$email_subject = "An email from your blog.";
    
    
    	function died($error) {
    		// your error code can go here
    		echo "We are very sorry, but there were error(s) found with the form you submitted. ";
    		echo "These errors appear below.<br /><br />";
    		echo $error."<br /><br />";
    		echo "Please go back and fix these errors.<br /><br />";
    		die();
    	}
    
    	// validation expected data exists
    	if(!isset($_POST['PersonName']) ||
    		!isset($_POST['PersomComment']) ||
    		!isset($_POST['PersonEmail']) ||
    		!isset($_POST['PersonNumber'])) {
    		died('We are sorry, but there appears to be a problem with the form you submitted. One or more fields were empty or contained invailid charicters.');      
    	}
    
    	$person_name = $_POST['PersonName']; // required
    	$person_comment = $_POST['PersomComment']; // required
    	$person_email = $_POST['PersonEmail']; // required
    	$person_number = $_POST['PersonNumber']; // not required
    
    
    	$error_message = "";
    	$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
      if(!preg_match($email_exp,$person_email)) {
    	$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
      }
    	$string_exp = "/^[A-Za-z .'-]+$/";
      if(!preg_match($string_exp,$person_name)) {
    	$error_message .= 'The Name you entered does not appear to be valid.<br />';
      }
      if(strlen($person_comment) < 2) {
    	$error_message .= 'The Comments you entered do not appear to be valid.<br />';
      }
      if(strlen($error_message) > 0) {
    	died($error_message);
      }
    	$email_message = "Form details below.\n\n";
    
    	function clean_string($string) {
    	  $bad = array("content-type","bcc:","to:","cc:","href");
    	  return str_replace($bad,"",$string);
    	}
    
    	$email_message .= "First Name: ".clean_string($person_name)."\n";
    	$email_message .= "Email: ".clean_string($person_email)."\n";
    	$email_message .= "Telephone: ".clean_string($person_number)."\n";
    	$email_message .= "Comments: ".clean_string($person_comment)."\n";
    
    
    // create email headers
    $headers = 'From: '.$person_email."\r\n".
    'Reply-To: '.$person_email."\r\n" .
    'X-Mailer: PHP/' . phpversion();
    @mail($email_to, $email_subject, $email_message, $headers); 
    }
    ?>
    
    

     

     

  9. I have button that inserts test into a textbox in addition to it's current value. Current it's placing the new value to the end of the current value. What i need is for it to insert this additional string to the current place of the cursor.

    Does anyone know a solution for this problem.

    <script type="text/javascript">
    function addquote() {
    	quote = "[quote][/quote]";
    	document.ArticleForm.ArticleBody.value = document.ArticleForm.ArticleBody.value+= quote;
    }
    </script>
    

  10. I use a text area. When i check the post inside my database it shows paragraphs but when i try echo that record column out it doesn't show the paragraphs it just shows one big chunk of text. 

     

              	<div id="ArticleBody" style="font-size:13px; font-size: 13px; margin-top: 26px; width: 729px;">
                              <?php echo bbcode($results['post']); ?>
                   </div>
    

×
×
  • 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.