1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need help editing a PHP file!

Discussion in 'Hire a Freelancer' started by thizzladen, Nov 25, 2010.

Tags:
  1. thizzladen

    thizzladen Power Member

    Joined:
    Jul 11, 2009
    Messages:
    591
    Likes Received:
    450
    Occupation:
    Doing whatever bakes the cake.
    Location:
    In house. With television and remote control.
    I'm trying to edit a PHP file for a Wordpress template. This is so users can login and submit posts externally from a page in my blog.

    Theres 4 inputs.

    Title
    Tags
    Category
    Content

    I'm trying to make it so that anything typed in "Content" shows up as comment in the post while the first 3 inputs are part of the actual post. Right now Content just shows as part of the post but I want it to be the first comment. I also want an additional input called "Image Link" where users can add a link to there post's image and it will show it in the post content.

    Here's the script eg.

    Code:
    <?php 
    /*
    Template Name: Register Page Template
    */
    ?>
    <?php get_header(); ?>
    <?php the_post(); ?>
    
    <div id="main-area">
    
    	<?php include(TEMPLATEPATH . '/includes/breadcrumbs.php'); ?>
    
    	<?php if (get_option('askit_integration_single_top') <> '' && get_option('askit_integrate_singletop_enable') == 'on') echo(get_option('askit_integration_single_top')); ?>
    	
    	<div class="entry page">
    		<div class="entry-top"> 
    			<div class="entry-content">
    				<h2 class="title"><?php the_title(); ?></h2>	
    				<div class="clear"></div>
    
    				<div class="page-separator"></div>
    				
    				<div class="post-content">
    					<?php if ( current_user_can('manage_options') && !get_option('users_can_register') ) { ?>
    						<p><?php _e('Note: You can activate users registration on WP-Admin / Setting / General page', 'AskIt'); ?></p>
    					<?php } ?>
    					
    					<?php if ( !is_user_logged_in() ) { ?>
    					
    						<?php if ( !get_option('users_can_register') ) { ?>
    							<h3><?php _e('Users cannot currently register themselves, only administrator can manually create users.', 'AskIt' ); ?></h3>
    						<?php } else { ?>
    							<div id="register-form">  
    								<?php #echo site_url($_SERVER['REQUEST_URI']); 
    								echo get_permalink(); ?>
    								<div class="title">  
    									<h2><?php _e('Login', 'AskIt'); ?></h2>
    								</div>  
    								<?php wp_login_form( array( 'redirect' => get_permalink() ) ); ?>
    								
    								<div class="clear"></div>
    								
    								<div class="page-separator"></div>
    								
    								<div class="title">  
    									<h2><?php _e('Register your Account', 'AskIt'); ?></h2>
    								</div>  
    								<form action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post">  
    									<p class="clearfix">
    										<label for="user_login" class="inputlable"><?php _e('Username','AskIt'); ?>:</label>
    										<input type="text" name="user_login" value="" id="user_login" class="input" />
    									</p>
    									
    									<p class="clearfix">
    										<label for="user_email" class="inputlable"><?php _e('E-Mail','AskIt'); ?>:</label>
    										<input type="text" name="user_email" value="" id="user_email" class="input"  />  
    									</p>
    									
    									<?php do_action('register_form'); ?>  
    									<p><input type="submit" value="<?php _e('Register','AskIt'); ?>" id="register" class="register" /></p>
    									
    									<p class="statement"><?php _e('A password will be e-mailed to you.', 'AskIt');?></p>
    								</form>  
    							</div>
    						<?php } ?>
    						
    					<?php } else { ?>
    						
    						<?php 
    							$post_created_error = '';
    							$result = false;
    														
    							if ( isset($_POST['et_add_answer']) ) {
    								if ( $_POST['et_newpost_title'] <> '' && $_POST['et_newpost_content'] <> '' ) {
    									$my_post = array(
    										'post_title' => $_POST['et_newpost_title'],
    										'post_content' => $_POST['et_newpost_content'],
    										'tags_input' => $_POST['et_newpost_tags'],
    										'post_category' => array( (int)$_POST['et_newpost_category'] ),
    										'post_status' => 'publish'
    									);
    
    									$result = wp_insert_post( $my_post );
    								}
    								else $post_created_error = '<p id="create_done">'.__('Make sure you fill all fields', 'AskIt').'</p>';
    							} ?>
    		
    						
    							<div id="create_new_post">
    								<?php if ($result == false) { ?>
    									<?php echo $post_created_error; ?>
    									<form action="<?php echo(get_permalink($post->ID)); ?>#create_new_post" method="post">
    										<p class="clearfix">
    											<label for="et_newpost_title" class="inputlable"><?php _e('Title','AskIt'); ?>:</label>
    											<input type="text" name="et_newpost_title" value="<?php echo $_POST['et_newpost_title']; ?>" id="et_newpost_title" class="input" />
    										</p>
    										
    										<p class="clearfix">
    											<label for="et_newpost_tags" class="inputlable"><?php _e('Tags'); ?>:</label>
    											<input type="text" name="et_newpost_tags" value="<?php echo $_POST['et_newpost_tags']; ?>" id="et_newpost_tags" class="input" />
    											<small><?php _e('* separated with commas','AskIt'); ?></small>
    										</p>
    										
    										<p class="clearfix">
    											<label for="et_newpost_category" class="inputlable"><?php _e('Category'); ?>:</label>
    											<?php $cats_array = get_categories('hide_empty=0'); ?>
    											<select id="et_newpost_category" name="et_newpost_category">
    												<?php foreach ( $cats_array as $category ) { ?>
    													<option value="<?php echo $category->cat_ID; ?>"><?php echo $category->cat_name; ?></option>
    												<?php } ?>	
    											</select>
    										</p>
    										
    										<p class="clearfix">
    											<label for="et_newpost_content" class="inputlable"><?php _e('Content', 'AskIt');?>:</label>
    											<textarea name="et_newpost_content" id="et_newpost_content" class="input"><?php echo $_POST['et_newpost_content']; ?> </textarea>
    										</p>
    <p class="clearfix">
    											<label for="et_newpost_content" class="inputlable"><?php _e('Content', 'AskIt');?>:</label>
    											<textarea name="et_newpost_content" id="et_newpost_content" class="input"><?php echo $_POST['et_newpost_content']; ?> </textarea>
    										</p>									
    										<input type="hidden" name="et_add_answer" value="proccess" />
    										<input class="register" type="submit" value="<?php _e('Submit','AskIt'); ?>" id="submit" />
    									</form>
    								<?php } else { ?>
    									<p id="create_done"><?php _e('The post was created.','AskIt'); ?> <a href="<?php echo( get_permalink($result) ); ?>"><?php _e('View the post','AskIt'); ?></a> | <a href="<?php echo get_permalink(get_pageId(get_option('askit_answer_page'))); ?>"><?php _e('Add another.','AskIt'); ?></a></p>
    								<?php } ?>
    							</div> <!-- end #create_new_post -->
    
    					<?php } ?>
    					<div class="clear"></div>
    				</div>
    			</div> <!-- end .entry-content -->
    		</div> <!-- end .entry-top -->
    	</div> <!-- end .entry -->
    
    	<div class="clear"></div>
    			
    	<?php if (get_option('askit_integration_single_bottom') <> '' && get_option('askit_integrate_singlebottom_enable') == 'on') echo(get_option('askit_integration_single_bottom')); ?>
    						
    </div> <!-- end #main-area -->
    
    <?php get_sidebar(); ?>	
    		
    <?php get_footer(); ?>
     
  2. MailBoxSeller

    MailBoxSeller Regular Member

    Joined:
    Oct 23, 2009
    Messages:
    236
    Likes Received:
    5
    How much would you pay for it?
     
  3. risefromdeath

    risefromdeath Power Member

    Joined:
    Jul 1, 2009
    Messages:
    650
    Likes Received:
    107
    Please pm me with your budget and skype id..i am free right now..will get this done in next hour or two for you
    Thanks