Jump to content

b

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

b's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Brilliant! It works great...http://www.minimlpress.com/ - (just a testing ground) You've been very helpful, and I'm going to give you full credit in the development of this theme! I've learned a lot in this process. Very much appreciated.
  2. Unfortunately, it didn't work. I tried to echo <?php echo $newWidth ?> and it didn't show up...
  3. It only seems to be echoing in the header section from this: <?php if ($mp_960 == "true") { $newHeight="180"; $newWidth="470"; ?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/960.css" type="text/css" media="screen,projection" /> <?php }?> When I echo <?php echo $newHeight ?> and <?php echo $newWidth ?> it doesn't appear anywhere - perhaps I'm doing that incorrectly?
  4. Sure. Here's the index.php <?php get_header(); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="gallery"> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <!-- the title --> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <!-- the date --> <p><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></p> <!-- Start Tim Thumb --> <?php if ( get_post_meta($post->ID, 'thumb', true) ) { ?> <div class="postthumb"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&<?php echo "h=".$newHeight."&w=".$newWidth; ?>&zc=1" alt="<?php the_title(); ?>" /></a></div> <?php } ?> <!-- End Tim Thumb --> <!-- the Content --> <?php the_content('Read the rest of this entry »'); ?> <!-- the Tags & Comments --> <p><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p> </div> </div> <?php endwhile; ?> <!-- else --> <?php else : ?> <h2>Not Found</h2> <p>Sorry, but you are looking for something that isn't here.</p> <?php get_search_form(); ?> <?php endif; ?> <!-- end else --> <?php get_footer(); ?> Here's the head section: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> <!-- Admin Options --> <? global $options; foreach ($options as $value) { if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); } } ?> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?>" href="<?php echo $mp_feedburner; ?>" /> <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/global.css" type="text/css" media="screen,projection" /> <!-- Layout Options --> <?php if ($mp_720 == "true") {?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/720.css" type="text/css" media="screen,projection" /> <?php }?> <?php if ($mp_840 == "true") {?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/840.css" type="text/css" media="screen,projection" /> <?php }?> <?php if ($mp_960 == "true") { $newHeight="180px"; $newWidth="470px"; ?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/960.css" type="text/css" media="screen,projection" /> <?php }?> <?php if ($mp_dark == "true") {?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/dark.css" type="text/css" media="screen,projection" /> <?php }?> <?php if ($mp_two_column == "true") {?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/two-column.css" media="screen,projection" /> <?php }?> <?php if ($mp_two_column_wide == "true") {?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/two-column-wide.css" type="text/css" media="screen,projection" /> <?php }?> <!-- Comments Script Thanks to Chris Coyier from CSS-Tricks --> <SCRIPT TYPE="text/javascript"> function setbg(color) { document.getElementById("comment").style.background=color } </SCRIPT> <?php wp_head(); ?> </head> Not sure if would help to see this code but here is the theme option in the functions.php: array( "name" => __('960px'), "desc" => __("960px Width"), "id" => $shortname."_960", "std" => "false", "type" => "checkbox"),
  5. I echoed: <?php echo $newHeight ?> <?php echo $newWidth ?> and got: 180 & 470 does it matter that the variables in the tim thumb script are : $new_width and $new_height and not $newWidth and $newHeight? I tried it but it didn't make a difference...just wondering
  6. well...I'm clearly a nuisance at this point. but it doesn't seem to work. however, the tim thumb script does seem to be resizing the image to be 200px wide and 180px height. how it's doing this is, to me, unclear. here is the testing url I'm using to figure this out: http://www.minimlpress.com/ the idea is to allow the user the option to choose a different style sheet for their site. if they choose the 960px width style sheet I wanted the images to resize to 470px, thus showing two columns. I'm calling the tim thumb script like this: <!-- Start Tim Thumb --> <?php if ( get_post_meta($post->ID, 'thumb', true) ) { ?> <div class="postthumb"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&<?php echo "h=".$newHeight."&w=".$newWidth; ?>&zc=1" alt="<?php the_title(); ?>" /></a></div> <?php } ?> <!-- End Tim Thumb --> And in the header it looks like this: <?php if ($mp_960 == "true") { $newHeight="180"; $newWidth="470"; ?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/960.css" type="text/css" media="screen,projection" /> <?php }?> It is calling properly the style sheet, but the image is not resizing to 470px. Not sure why. If I'm being annoying, I apologize. thanks again
  7. Seems like that should work, but it doesn't. Here's what I have in the header: <?php if ($mp_960 == "true") { $newHeight="180"; $newWidth="470"; ?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/960.css" type="text/css" media="screen,projection" /> <?php }?> And here is what I have in the index.php <!-- Start Tim Thumb --> <?php // This will show the image and link the image to the post. Alter the width and height (in both places) to your needs. ?> <?php if ( get_post_meta($post->ID, 'thumb', true) ) { ?> <div class="postthumb"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&h=$newHeight&w=$=$newWidth&zc=1" alt="<?php the_title(); ?>" /></a> </div> <?php } ?> <!-- End Tim Thumb --> And here is what I believe is the relevant code in Tim Thumb // get properties $new_width = preg_replace("/[^0-9]+/", "", get_request("w", 0)); $new_height = preg_replace("/[^0-9]+/", "", get_request("h", 0)); $zoom_crop = preg_replace("/[^0-9]+/", "", get_request("zc", 1)); $quality = preg_replace("/[^0-9]+/", "", get_request("q", 80)); $filters = get_request("f", ""); if ($new_width == 0 && $new_height == 0) { $new_width = 200; $new_height = 180; } Confused why that didn't work...Seems like you were right, but something must be missing. Thanks again
  8. Thanks...I'm calling the css stylesheet in the header like this: <?php if ($mp_960 == "true") {?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/960.css" type="text/css" media="screen,projection" /> <?php }?> This is if the user selects the 960px width option. Not sure where to put that variable, however Sorry for the noob questions
  9. Not sure how to define $newWidth and $newHeight based on the style sheet ...
  10. Sounds like it could work. Let me give it a try, and I'll let you know. Thanks!
  11. Not sure how to work this. I essentially want to call a variety of image sizes based on which stylesheet a user chooses from the administration backend of a wordpress theme. The sizes of the images would be different depending on which stylesheet is selected. My idea is to write an if/else statement to accomplish this, but don't know how. The script looks like this: <?php // This will show the image and link the image to the post. Alter the width and height (in both places) to your needs. ?> <?php if ( get_post_meta($post->ID, 'thumb', true) ) { ?> <div class="postthumb"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&h=180&w=200&zc=1" alt="<?php the_title(); ?>" width="200" height="180" /></a> </div> <?php } ?> If the user selects a layout utilizing a 200px wide image this script would work, but if they choose a layout using a 300px width image the Tim Thumb script would have to be obviously different. Basically, I would like to offer a different Tim Thumb script based on whatever layout/stylesheet the user selects. And I think the best way is to offer an if/else statement, but I don't know how to do this... Any help would be greatly appreciated... Thanks!
  12. Hi I would like to offer a CC function that would allow a registered user the option to copy the registration form they just filled out to go to their registered email address... Could anyone point me in the right direction? Thanks
  13. hate to sound too needy but I'm not sure how to do that...
  14. Thanks for the suggestion...Here is what I have: A very simple registration form with some javascript validation: register.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- .style12 {font-family: Verdana, Arial, Helvetica, sans-serif} .style28 {color: #FF0000} .style29 {font-family: Arial, Helvetica, sans-serif} --> </style> </head> <body> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td><div align="justify"> <form action="submit.php" method="post" name="regform" id="regform" onsubmit="return Validate()"> <table width="75%" border="0" align="center" cellpadding="1" cellspacing="0"> <tr> <td bgcolor="#E54F1A"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td bgcolor="#FEF7F3"> </td> </tr> <tr> <td align="right" bgcolor="#FEF7F3"><span class="style28">*</span> Fields are Manditory </td> </tr> <tr> <td bgcolor="#FEF7F3"> </td> </tr> <tr> <td bgcolor="#FEF7F3"><table width="90%" height="320" border="0" align="center" cellpadding="3" cellspacing="0"> <tr bgcolor="#FEF7F3" class="style29"> <td>Full Name <span class="style28">*</span> </td> <td align="center">:</td> <td class="style29"><input name="name" type="text" id="name" size="21" /></td> </tr> <tr bgcolor="#FEF7F3" class="style29"> <td>E-Mail ID <span class="style28">*</span> </td> <td align="center">:</td> <td class="style29"><input name="email" type="text" id="email" size="21" /></td> </tr> <tr bgcolor="#FEF7F3" class="style29"> <td>1st <span class="style28">*</span> </td> <td align="center">:</td> <td class="style29"><input name="one" type="text" id="first" size="21" /></td> </tr> <tr bgcolor="#FEF7F3" class="style29"> <td>2nd <span class="style28">*</span> </td> <td align="center">:</td> <td class="style29"><input name="two" type="text" id="second" size="21" /></td> </tr> <tr bgcolor="#FEF7F3" class="style29"> <td>3rd <span class="style28">*</span> </td> <td align="center">:</td> <td class="style29"><input name="three" type="text" id="third" size="21" /></td> </tr> <tr bgcolor="#FEF7F3" class="style29"> <td>4th <span class="style28">*</span> </td> <td align="center">:</td> <td class="style29"><input name="four" type="text" id="fourth" size="21" /></td> </tr> <!--<tr bgcolor="#FEF7F3" class="style29"> <td>Address<span class="style28">*</span></td> <td align="center">:</td> <td class="style29"><textarea name="address" cols="16" rows="4" wrap="virtual" id="address"></textarea></td> </tr>--> <!--<tr bgcolor="#FEF7F3" class="style29"> <td>Phone Number <span class="style28">*</span> </td> <td align="center">:</td> <td class="style29"><input name="phone" type="text" id="phone" size="21" onkeyup="Only_Num(this.id)" /></td> </tr>--> <!--<tr bgcolor="#FEF7F3" class="style29"> <td>Mobile Number<span class="style28">*</span> </td> <td align="center">:</td> <td class="style29"><input name="mobile" type="text" id="mobile" size="21" onchange="javascript:LA()" onkeyup="Only_Num(this.id)" /></td> </tr>--> <tr bgcolor="#FEF7F3" class="style29"> <td height="97">Comments <span class="style28">*</span> </td> <td align="center">:</td> <td class="style29"><textarea name="comments" wrap="virtual" id="comments"></textarea></td> </tr> <tr align="center" bgcolor="#FEF7F3" class="style29"> <td colspan="3" class="style12"><input name="Submit" type="submit" class="style29" id="Submit" value="Submit" onclick="return chk()" /> <input name="Reset" type="reset" class="style29" value="Reset" /> <script>//global variable for error flag var errfound = false; //function to validate by length function ValidLength(item, len) { return (item.length >= len); } //function to validate an email address function ValidEmail(item) { if (!ValidLength(item, 5)) return false; if (item.indexOf ('@', 0) == -1) return false; return true; } // display an error alert function error(elem, text) { // abort if we already found an error if (errfound) return; window.alert(text); elem.select(); elem.focus(); errfound = true; } // main validation function function Validate() { errfound = false; if (!ValidLength(document.regform.name.value,6)) error(document.regform.name,"Name : minimum 6 characters"); if (!ValidLength(document.regform.address.value,10)) error(document.regform.address, "Invalid Address"); if (!ValidLength(document.regform.phone.value,10)) error(document.regform.phone,"Invalid phone number"); if (!ValidLength(document.regform.mobile.value,10)) error(document.regform.mobile,"Invalid mobile number"); if (!ValidEmail(document.regform.email.value)) error(document.regform.email, "Invalid Email Address"); if (!ValidLength(document.regform.comments.value,5)) error(document.regform.comments, "please Enter Your Comments"); return !errfound; /* true if there are no errors */ } </script><script language="JavaScript"> function Only_Num(id) { if(isNaN(document.getElementById(id).value)) { alert("Please Enter Numbers Only (0-9).."); document.getElementById(id).select(); document.getElementById(id).value="" document.getElementById(id).focus(); } return; } </script> </td> </tr> </table></td> </tr> <tr> <td bgcolor="#FEF7F3"> </td> </tr> <tr> <td bgcolor="#FEF7F3"> </td> </tr> </table></td> </tr> </table> </form> </div></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> </body> </html> Submit.php <? if($_SERVER['REQUEST_METHOD']=="POST") { $mail_body.='<style type=text/css><!-- body,td,th {font-family: Arial, Helvetica, sans-serif; font-size: 12px;color: #666666;}--></style> <table width=60% border=0 align=center cellpadding=1 cellspacing=0> <tr> <td bgcolor=#E54F1A><table width=100% border=0 align=center cellpadding=3 cellspacing=0 bgcolor=#FFFFFF> <tr align=center bgcolor=#FEF7F3> <td colspan=3><strong>Feedback Form</strong></td> </tr> <tr bgcolor=#FEF7F3> <td width=26% >Full Name </td> <td width=3% align=center>:</td> <td width=71% >'.$_POST['name'].'</td> </tr> <tr bgcolor=#FEF7F3> <td>E-Mail ID</td> <td align=center>:</td> <td>'.$_POST['email'].'</td> </tr> <tr bgcolor=#FEF7F3> <td width=26% >1 </td> <td width=3% align=center>:</td> <td width=71% >'.$_POST['one'].'</td> </tr> <tr bgcolor=#FEF7F3> <td width=26% >2 </td> <td width=3% align=center>:</td> <td width=71% >'.$_POST['two'].'</td> </tr> <tr bgcolor=#FEF7F3> <td width=26% >3 </td> <td width=3% align=center>:</td> <td width=71% >'.$_POST['three'].'</td> </tr> <tr bgcolor=#FEF7F3> <td width=26% >4 </td> <td width=3% align=center>:</td> <td width=71% >'.$_POST['four'].'</td> </tr> <tr bgcolor=#FEF7F3> <td valign=top>Comments </td> <td align=center valign=top>:</td> <td>'.$_POST['comments'].'</td> </tr> </table> </td> </tr> </table>'; //echo $mail_body;exit; $mailto = '###'; $from='###'; $mailheader.="Return-Path: ".$from."\n"; $mailheader .= "From: ".$from."\n"; $mailheader .= 'MIME-Version: 1.0' . "\r\n"; $mailheader .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $mailheader.='From:'.$_POST['email']. "\r\n"; @mail($mailto,'Feedback Form',$mail_body,$mailheader); echo '<script language="javascript">window.location.href="thankyou.php";</script>'; } ?> In order to prevent multiple IP address entrants where would I put: <?php $ip = $_SERVER["REMOTE_ADDR"]; ?> Thanks!
  15. Hi, I would like to put together a PHP Form that allows only one submission per IP address. Can anyone point me in the right direction for this...I know how to write a PHP form, interact with the database, etc. But I don't know what code to use that would involve IP address limitation... Thanks very much
×
×
  • 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.