Secret Codes






General Codes:
*#06# – Display’s IMEI number.
*2767*3855# – This code will Format your device to factory state (will delete everything on phone).
*#*#4636#*#* – Display’s Phone information, usage statistics and battery.
*#*#273282*255*663282*#*#* – This code will Immediately backup of all media files.
*#*#197328640#*#* – This code will Enable test mode for service.
*#*#1111#*#* – Will display FTA software version.
*#*#1234#*#* – Will show PDA and firmware version.
*#*#232339#*#* – Wireless LAN tests.
*#*#0842#*#* – This code is used for Backlight/vibration test.
*#12580*369# – Display’s Software and hardware info.
*#*#2664#*#* – This code is used for Testing the touchscreen.
*#9900# – System dump mode.
*#9090# – Diagnostic configuration.
*#*#34971539#*#* – Will display Detailed camera information.
*#872564# – USB logging control.
*#301279# – HSDPA/HSUPA Control Menu.
*#7465625# – This code will display phone’s lock status.
*#0*# – Enter the service menu on newer phones like Galaxy S III.
*#*#7780#*#* – Reset the /data partition to factory state.
Basic Codes:
*#*#7780#*#* – This code is used for factory restore setting.This will remove Google account setting and System and application data and settings.
*2767*3855# – This code is used for factory format, and will remove all files and settings including the internal memory storage. It will also re install the firmware.
*#*#4636#*#* – This code show information about your phone and battery.
*#*#273283*255*663282*#*#* – This code opens a File copy screen where you can backup your media files e.g. Images, Sound, Video and Voice memo.
*#*#197328640#*#* – This code can be used to enter into Service mode. You can run various tests and change settings in the service mode.
*#*#7594#*#* – This code enable your “End call / Power” button into direct power off button without asking for selecting any option(silent mode, aero plane and power-off).
*#*#8255#*#* – This code can be used to launch G Talk Service Monitor.
*#*#34971539#*#* – This code is used to get camera information. Please avoid update camera firmware option.
W-LAN, GPS and Bluetooth Test Codes:
*#*#232339#*#* OR *#*#526#*#* OR *#*#528#*#* – W-LAN test (Use “Menu” button to start various tests).
*#*#232338#*#* – Shows WiFi MAC address.
*#*#1472365#*#* – GPS test.
*#*#1575#*#* – Another GPS test.
*#*#232331#*#* – Bluetooth test.
*#*#232337#*# – Shows Bluetooth device address.
Codes to launch various Factory Tests:
*#*#0842#*#* – Device test (Vibration test and BackLight test).
*#*#0588#*#* – Proximity sensor test.
*#*#0*#*#* – LCD test.
*#*#2664#*#* – Touch screen test.
*#*#2663#*#* – Touch screen version.
*#*#0283#*#* – Packet Loopback.
*#*#0673#*#* OR *#*#0289#*#* – Melody test.
*#*#3264#*#* – RAM version.
Code for firmware version information:
*#*#1111#*#* – FTA SW Version.
*#*#2222#*#* – FTA HW Version.
*#*#44336#*#* – PDA, Phone, CSC, Build Time, Changelist number.
*#*#4986*2650468#*#* – PDA, Phone, H/W, RFCallDate.
*#*#1234#*#* – PDA and Phone.



These codes are used only by technicians, So be careful with them and use it at your own risk.

0 comments:

registred user using WP







Get registred user role in wordpress



The simplest and the easiest way to do so is to use get_userdata() wordpress function.
The example of code is given bellow

global $wpdb;
$user_id = get_current_user_id();
$user_info = get_userdata($user_id);
echo ‘Username: ‘ . $user_info->user_login . “\n”;
echo ‘User roles: ‘ . implode(‘, ‘, $user_info->roles) . “\n”;
echo ‘User ID: ‘ . $user_info->ID . “\n”;
?>

0 comments:

Using .htaccess



htaccess

Protecting PHP projects using .htaccess file

                                 
Lets starts with hiding .php extension. But for that we need to create .htaccess file first. It is very simple to create. Follow the instruction to create .htaccess file.
  • Open you notepad
  • Save the file with .htaccess.
  • Upload the file on root directory.

Hiding .php extension
if you need to hide .php extension like (http://yousitename.com/home.php to http://www.yousitename.com/home ) you just need to add the following code into your .htaccess file

RewriteEngine on
RewriteRule ^(.*)\$ $1.php

With .htaccess we can also rewrite extension like .html .asp etc

For this you just need to add following code into you htaccess file

RewriteEngine on
RewriteRule ^(.*)\.html$ $1.php (Replace .html with any you desired extension to show)

Url rewriting
You can also rewrite you ugly and non-user-friendly urls to beautiful and user-friendly urls like (http://www.yousite.com/category.php?name=categoryname ) to (http://www.yousite.com/categoryname) for this you need to add the following like of codes into your .htaccess file

RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ profile.php?username=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ profile.php?username=$1

0 comments:

Cannot Modify Header Information

CannotModifyHeader
Headers already sent



the simplest solutions of this issue is to find your wp-config.php and this this code on the first line of wp-config.php
ob_start();
error_reporting(0); 

if you find this post helpful . don’t forget to share this and follow my blog.

0 comments:

Custom widgets



 SonyDaman

How to make widgets in WordPress

1. first of all you need to find out the widget.php in your theme . if there is no widget.php you can create your own.
copy and paste the given code in widget.php

class bottom_widget_quote extends WP_Widget {
// Create Widget
function widget() {
parent::WP_Widget(false, $name = ‘Widget Name’, array(‘description’ => ”));
}
// Widget Content
function widget($args, $instance) {
extract( $args );
$title= strip_tags($instance[‘title’]);
$details= strip_tags($instance[‘details’]);
?>




}

// Update and save the widget
function update($new_instance, $old_instance) {
return $new_instance;
}
// If widget content needs a form
function form($instance) {
//widgetform in backend
$title= strip_tags($instance[‘title’]);
$details= strip_tags($instance[‘details’]);
?>


get_field_id(‘title’); ?>” name=”get_field_name(‘title’); ?>” type=”text” value=”” />



get_field_id(‘details’); ?>” name=”get_field_name(‘details’); ?>” type=”text” value=”” />


}

}
register_widget(‘bottom_widget_quote’);

this code is enough to register your widget .
2. second step is to declare a space in your wp-admin dashboard for that you need to copy and paste the following code in your function.php
if ( function_exists(‘register_sidebar’) )
register_sidebar( array(
‘name’ => __( ‘Widget Name’),
‘id’ => ‘mycustomwidgetarea5′,
‘description’ => __( ‘An optional widget area for your site footer’, ‘twentyeleven’ ),
‘before_widget’ => ‘




‘after_widget’ => “
”,
‘before_title’ => ‘

’,

‘after_title’ => ‘’,
) );
3. now the third step is to display the content of your widget . for that you need to copy and paste the following code to your desired place in you theme 

// Custom widget Area Start
if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘Widget Name’) ) : ?>

// Custom widget Area End
?>

0 comments:

Hide options for specific user/admin


Hide theme options in wordpress for specific user/admin





There are many methods to do so but the effect methods are
Hide theme options in wordpress for specific user/admin
  1. With CSS
  2. With WordPress hide function
You can use any one of the above given method to hide theme options.
But remember that if you use css you have to write css in you function.php no in you css
Syntax of the hiding theme option or any other menu form wp-admin in wordpress with css is given bellow

add_action(‘admin_head’, ‘my_custom_style’);
function my_custom_style() {
echo ‘’;
}
?>
Change the css id and class according your theme ID and Classes
Here is the 2nd method to hide theme option with WordPress built in function function remove_submenu_page. In this function set the user id of a specific user to hide the options
Syntax is given bellow

function hide_menu() {
global $current_user;
$user_id = get_current_user_id();
// echo “user:”.$user_id;   // this will display user id
if($user_id != ‘1’) {
// To remove the whole Appearance admin menu you would use;
remove_menu_page( ‘themes.php’ );
// To remove the theme editor and theme options submenus from
// the Appearance admin menu, as well as the main ‘Themes’
// submenu you would use
remove_submenu_page( ‘themes.php’, ‘themes.php’ );
remove_submenu_page( ‘themes.php’, ‘theme-editor.php’ );
remove_submenu_page( ‘themes.php’, ‘theme_options’ );
remove_submenu_page( ‘themes.php’, ‘_options’ );
}
}
add_action(‘admin_head’, ‘hide_menu’);
?>
Remember this function can’t completely disable the theme options. It can be directly accessible by entering the url in address bar of a browser

0 comments:

CUSTOM SHOW POST USIN WORDPRESS






Get post view without any plugin in WordPress



Get post view without any plugin in WordPress


Follow the steps given bellow


  1. Go to your theme’s function.php and add the following code in it.
function getPostViews($postID){
    $count_key = ‘post_views_count’;
    $count = get_post_meta($postID, $count_key, true);
    if($count==”){
        delete_post_meta($postID, $count_key);
        add_post_meta($postID, $count_key, ‘0’);
        return “0 View”;
    }
    return $count.’ Views’;
}

function setPostViews($postID) {
    $count_key = ‘post_views_count’;
    $count = get_post_meta($postID, $count_key, true);
    if($count==”){
        $count = 0;
        delete_post_meta($postID, $count_key);
        add_post_meta($postID, $count_key, ‘0’);
    }else{
        $count++;
        update_post_meta($postID, $count_key, $count);
    }
}
remove_action( ‘wp_head’, ‘adjacent_posts_rel_link_wp_head’, 10, 0);
  1. This step tracking the view of the post so post the following code in single.php where you want to display the post views.
setPostViews(get_the_ID());
?>

4 comments:

Create Login Page in WordPress

Create a custom WordPress Page



             

First of all create a custom page in the root folder of your WordPress theme and name it custom_login.php . At the top of the page write Template Name like


Using $user_login

$user_login is a global variable which helps us find the current user login data. With which we can easily find out about the following activity of a particular user.

Check if Login Failed

If user tries to login with wrong credentials, WordPress will return a query string ?login=failed. This will in turn be used to display an error message.

Check if User is already logged in

In it  I used userLoggedIn() function to check if the user is already logged in. So, if an already logged in user tends to revisit the login page, he’ll get a message about returning home or logging out. There is no sense in displaying the login form to an already logged in user.

Else display the login form

In this part I used wp_login_form() function with some arguments to display the contact form. Here you need to pay attention to the particular argument ‘redirect’ => home_url(‘/wp-admin/’), this is basically redirecting user after login to home_url(‘path-here’). You can easily change the path to redirect a user to another page E.g. a custom front-end dashboard.

Live Example

Don’t forget to publish the page from admin panel Pages > Add New > Select the template name.

        
<!– section –>   





      

   
       if(isset($_GET[‘login’])&&$_GET[‘login’]==’failed’) {            ?>        
       
     Invalid combination!
       
       
     
            } else {              
           wp_login_form($args);        
          $args = array(                     
          ‘echo’           => true,                   
          ‘redirect’       => home_url(‘/wp-admin/’),            
          ‘form_id’        => ‘loginform’,              
          ‘label_username’ => __( ‘Username’ ),                   
          ‘label_password’ => __( ‘Password’ ),                
          ‘label_remember’ => __( ‘Remember Me’ ),           
          ‘label_log_in’   => __( ‘Log In’ ),                  
          ‘id_username’    => ‘user_login’,                
          ‘id_password’    => ‘user_pass’,           
          ‘id_remember’    => ‘rememberme’,            
          ‘id_submit’      => ‘wp-submit’,            
          ‘remember’       => true,                    
          ‘value_username’ => NULL,              
          ‘value_remember’ => true                  
          );  }         ?>        
  
          <!– /section –>

0 comments: