son.of.the.morning
-
Posts
292 -
Joined
-
Last visited
Never
Posts posted by son.of.the.morning
-
-
Find the second hieghest value in a table using a simple query?
-
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.
-
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?
-
I would but i need the .basic item to be a href
-
I am using a jquery modal function but i have a loop of records and in the loop i have a button which i want to view a model with the corresponding data for each item returned in the while loop.
-
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; }); }); }); });
-
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?
-
no, there are numerious records. I maybe a retard when it comes to PHP but am not that stupid lol
-
thats what i used.
<?php $a = "SELECT * FROM blog_posts ORDER BY id DESC"; $query = mysql_query($a) or die (mysql_error()); while ($rows = mysql_fetch_assoc($query)){ print_r($rows); } ?>
-
it just returns the results one result from the query like so...
Array ( [id] => 272 => aston_martin21.jpg [title] => TEST POST! => Grand avant creve lilas il du se monde.
-
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']; } ?>
-
I dont want to loop data i wana be able to just use each record and column indervidualy
-
well there is more then one column in the table so i need to select one record and one column at a time.
<?php echo $query_results['title']['0']'; // i need to get the a single record from an single column. ?>
-
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?
-
I have tried both methods and no luck
-
I have an article page that loads a article up but if the article exceeds the hieght of the div it overflows. I know this isnt much of a PHP question, however it's driving me nuts!
-
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); } ?>
-
May i ask how?lol
-
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>
-
-
haha thanks for you help man
-
I have a solution using the nl2br() function.
-
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>
-
It's coming one big line for each paragraph with that :S
Php frameworks
in Miscellaneous
Posted
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?