Thursday, February 7, 2013

How to make the text box side bar rounded




If you required that to make the text box side bar rounded  then you can easily  make it by using the css property.
First of all you have to make a simple text box  .

<input type="text" name="site" value="Site Name" style="font-size:24px;"/>

Now you have to make the css property for the text box to make the corner rounded
Thease are as below

.login_fields input[type=text] {width:197px; height:20px;text-shadow: 0px 0px 1px #e4e4e4; border:0px; border-radius: 4px;-moz-border-radius: 6px;-webkit-border-radius: 6px;}

By using this class  when you include the class  in your text field it show the  rounded images .

<div class="login_fields"><input type="text" name="site" value="Site Name" style="font-size:24px;"/>
</div>

 Try it

How to add the  loader  on submit button when submit:

If you want  that when you click on login button then it show the other image of other color and then
 Loader on its side
By using java script property  onclick or by css property you can easily do this. You first have to download the images and name the same name  for images  as given or  can chage accordingly .
<script>
function  visibility()
{
        if(document.images)
    {
         
       
        document.images.loading3.style.visibility = 'visible';
        document.images.loading4.style.visibility='visible';}
       
       }
     </script>

<td><input type="image" src="images/btn_login.png" name="submit"  onclick = "javascript:return validateForm();"/>
            <img src="images/btn_logingrey.png"  border="0" name = "loading1" style = "visibility:hidden;margin-left: 10px;margin-top: -5px;"/></td>
            <td><img src="images/loading3.gif"  border="0" name = "loading2" style = "visibility:hidden;"/></td>

You can also  use this property also  for this 

<input type="image" src="images/btn_go.png" name="submit"style = "visibility:visible; float: left;" onclick="this.style.visibility = 'hidden'; if(document.images){document.images.loading.style.visibility = 'visible';}"/>
<img src="images/loading4.gif" alt="" class="left_flo" name = "loading" style = "visibility:hidden; margin-left:-64px;"/>


Apple TV 3rd Generation (MD199HN/A)


How To make a Widget in word press


-->


Hello friend  you can  easily make a simple widget   by the given format
 You  have only to give  you condition  query for the particular data to display from  your data base  or  you can easily set it in your wp side bar by dra and drop .

Code given below is

<?php
/*
Plugin Name: Per Page Post

Description: per page Post widget
Author: Vikas Gautam
Version: 2
Author URI: http://vikasbruce.blogspot.com/
*/

function sampleeventcategory()
{
   $page_name="index.php"; //  If you use this code with a different page ( or file ) name then change this
                                                                $start=$_GET['start'];
                                                                if(strlen($start) > 0 and !is_numeric($start)){
                                                                echo "Data Error";
                                                                exit;
                                                                }
                                                                $eu = ($start - 0);
                                                                $limit = 2;                                 // No of records to be shown per page.
                                                                $this1 = $eu + $limit;
                                                                $back = $eu - $limit;
                                                                $next = $eu + $limit;
                               
         $pname = $_REQUEST['event'];
   

/// here  you have to give your query and   show your date   or call data from data base



And after that you have to put the  code  

function widget_myeventcategory($args) {
  extract($args);

  $options = get_option("widget_myeventcategory");
  if (!is_array( $options ))
{
$options = array(
      'title' => 'My Widget Title'
      );
  }

  echo $before_widget;
    echo $before_title;
      echo $options['title'];
    echo $after_title;

    //Our Widget Content
    sampleeventcategory();
  echo $after_widget;
}

function myeventcategory_control()
{
  $options = get_option("widget_myeventcategory");
  if (!is_array( $options ))
{
$options = array(
      'title' => 'My Widget Title'
      );
  }

  if ($_POST['myeventcategory-Submit'])
  {
    $options['title'] = htmlspecialchars($_POST['myeventcategory-WidgetTitle']);
    update_option("widget_myeventcategory", $options);
  }

?>

  <p>
    <label for="myeventcategory-WidgetTitle">Widget Title: </label>
    <input type="text" id="myeventcategory-WidgetTitle" name="myeventcategory-WidgetTitle" value="<?php echo $options['title'];?>" />
    <input type="hidden" id="myeventcategory-Submit" name="myeventcategory-Submit" value="1" />
  </p>
<?php
}

function myeventcategory_init()
{
  register_sidebar_widget(__(' per page Post '), 'widget_myeventcategory');
  register_widget_control(   ' per page Post ', 'myeventcategory_control', 300, 200 );
}
add_action("plugins_loaded", "myeventcategory_init");
?>

How to use fck editor in php

First download the fck editor and ck finder and place them in your directory and  replace the path with your own path

basePath = 'you path here /ckeditor/';
CKFinder::SetupCKEditor($ckeditor, '/ckfinder/');
$ckeditor->editor('CKEditor1');
$FCKeditor->Width = '220px';
$FCKeditor->Height = '100px';
$ckeditor->ckeditor->config['toolbar'] = 'Full';
$ckeditor->ckeditor->config['language'] = 'en';

Cannot modify header information - pluggable.php


Warning: Cannot modify header information - headers already sent by (output started at /homepages/9/d260170483/htdocs/pettraining/wordpress-2.8/wordpress/wp-content/themes/dog-lover/functions.php:6) in /homepages/9/d260170483/htdocs/pettraining/wordpress-2.8/wordpress/wp-includes/pluggable.php on line 865

If you find this problem in your site  look the page you lastly updated or  the page  on which you are using header location  function   .
After  finding the  page or template  you need to put the   code on top of page
<?php   Ob_start();  ?>

After placing the code at top  save the file  and your problem will be resolved . if have any other issue let me know  or check file  again .

To create custom post from the front end with Feature image



  I f you want to create the custom post from the front with   feature  image end need simple wordpress function  wp_insert_posts();

$new_post = array('post_title'=>$title ,'post_content'  =>   $description,'post_category' =>   array($_POST['cat']),'post_status'=>'publish','post_type'=>  'post');
echo  $pid = wp_insert_post($new_post);
here  in the  variable  $title you have to pass the  title of you post and in
$description  the content you  want to upload   for the post
Array($_POST[‘cat’]) you can pass the category name of post in which you want to post

First you need to create simple html form  like this

<table class="accountForm">
<form method="post" name="insert_post_form" action="" enctype="multipart/form-data" onsubmit="return validateForm()">
<tr>
<td> Post Title: </td> <td> <input type="text" class="inputContact_acc" name="title" ></td>
</tr>
<tr>
<td> Post content: </td> <td><input type="text" class="inputContact_acc" name="content"></td>
</tr>
<tr>
<td> Post category:</td> <td><div class="input_bg1" style="margin-top:5px;"><?php wp_dropdown_categories( 'tab_index=10&taxonomy=category&hide_empty=0&include=4' ); ?></div></td>
</tr>

<tr>
<td> Feature Image : </td> <td> <input name="Feture_image" class="inputContact_acc"  type="file"></td>
</tr>
<tr>
<td></td>
<td>        <input type="submit" name="posted" value="Insert Post" style="background:black;color:#AAAAAA;border:0;width:110px;height:30px;font-weight:bold;border-radius:10px;"></td>
</tr>
</form>

</table>



Now for the  php code you need  to get these values


<?php
if(isset($_POST['posted'])) {



$allowedExts = array("JPG","jpg", "jpeg", "gif", "png");
$extension = end(explode(".", $_FILES["Feture_image"]["name"]));
if ((($_FILES["Feture_image"]["type"] == "image/gif")
||   ($_FILES["Feture_image"]["type"] == "image/jpeg")
||   ($_FILES["Feture_image"]["type"] == "image/png")
||   ($_FILES["Feture_image"]["type"] == "image/jpg"))
&& in_array($extension, $allowedExts) ) {





$get_parent=$_REQUEST['post_name'];
$title=$_REQUEST['title'];
$description=$_REQUEST['content'];


$new_post = array('post_title'=>$title ,'post_content'  =>   $description,'post_category' =>   array($_POST['cat']),'post_status'=>'publish','post_type'=>  'post');
echo  $pid = wp_insert_post($new_post);


add_theme_support( 'post-thumbnails', array( 'post' ) );


$upload_dir = wp_upload_dir();
$dir = trailingslashit($upload_dir['basedir']) . 'lostpets';
$tmppath = $_FILES['Feture_image']['tmp_name'];

if(!file_exists($dir) && @!mkdir($dir, 0777))
$error = sprintf(__("The userphoto upload content directory does not exist and could not be created. Please ensure that you have write permissions for the '%s' directory. Did you put slash at the beginning of the upload path in Misc. settings? It should be a path relative to the WordPress root directory. <code>wp_upload_dir()</code> returned:<br /> <code style='white-space:pre'>%s</code>", 'user-photo'), $dir, print_r($upload_dir, true));
if(!$error){
$imagefile = "$pid." .$_FILES['Feture_image']['name'];
$imagepath = $dir . '/' . $imagefile;
if(!move_uploaded_file($tmppath, $imagepath)){
$error = sprintf(__("Unable to place the user photo at: %s", 'Feture_image'), $imagepath);
}else{
$wp_filetype = wp_check_filetype(basename($imagepath));

$attachment = array(
'guid' => $imagepath,
'post_type'=>       'attachment',
'post_mime_type' => $wp_filetype['type'],
'post_title' => preg_replace('/\.[^.]+$/', '', basename($imagepath)),
'post_content' => '',
'post_status' => 'inherit'
);
$attach_id = wp_insert_attachment( $attachment, $imagepath, $pid );

require_once(ABSPATH . 'wp-admin/includes/image.php');
$attach_data = wp_generate_attachment_metadata( $attach_id, $imagepath );
wp_update_attachment_metadata( $attach_id, $attach_data );
set_post_thumbnail( $pid, $attach_id );
}
}
echo $error;

if($pid)
{
echo "<script>alert('you successfully posted your deal')</script>";
header('location:http://192.168.0.1/wordpress/carsen');
}

?>

<?php
}
else
{
echo "Try valid image type";
}
}


?>