vendredi 29 août 2014

Driver HP 2000 Wifi problem

if you can't enable the wifi in your HP 2000 notebook

please install the HP wireless assistant from here

http://sur.ly/o/h10025.www1.hp.com/ewfrf%2Fwc%2FsoftwareDownloadIndex%3Fsoftwareitem%3Dob-87841-1%26cc%3Duk%26lc%3Den%26dlc%3Den/AA001290

and by using slim driver update the network controller driver

after finishing installation please press FN+F12 to activate your wifi 

dimanche 3 août 2014

category not found for a custom post wordpress


my websit e works perfectly excet dislaying catgeiru for custom ost

the roblem was descivred by using a winderfukl lugin :

https://wordpress.org/plugins/rewrite-rules-inspector/

to discover wher the redirection goes?

by flushing and deleleting a revious custom category the roblem was resolved


////////////////////pour lister les adress ///
/*

add_action( 'init', 'addresse_init' );

function addresse_init() {
// create a new taxonomy

$labels = array(

'name' => __( 'adresse Categories', APP_TD ),

'singular_name' => __( 'adresse Category', APP_TD ),

xxxxxxxxxxxxxxxxxxx

);



$args = array(

xxxxxxxxxxx
'rewrite' => array( 'slug' => 'listings/category', 'with_front' => false ),

);



register_taxonomy( VA_LISTING_ADDRESSE, VA_LISTING_PTYPE, $args );
}

*/
/////////////////////

samedi 2 août 2014

compresser les images de wordpress

http://wordpress.org/plugins/wp-smushit/screenshots/

http://www.elegantthemes.com/blog/tips-tricks/optimize-images-for-your-wordpress-website

Check your current website performance


pour vérifier les performances de votre site voici 2 outils intéressant


http://developers.google.com/speed/pagespeed/insights/

http://gtmetrix.com/

How to: Speed up your WordPress site with gzip compression, accélérer wordpress par gzip


aciver la compression gzip pour les données wordpress pour accélerer l'affichage .

les serveur de godaddy support la copression gzip :
http://support.godaddy.com/help/article/6946/enabling-mod_deflate-with-your-hosting-account


pour l'activer sur wordpress ajouter les lignes suivantes à votre .htaccess de la racine :

# BEGIN GZIP
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddType x-font/otf .otf
AddType x-font/ttf .ttf
AddType x-font/eot .eot
AddType x-font/woff .woff
AddType image/x-icon .ico
AddType image/png .png
# END GZIP

pour tester si la compression est active :
http://www.whatsmyip.org/http-compression-test/?url=d3d3LnNvdWthc2ZpLmNvbQ==

ou bien sr chrome lancer un audit (F12=>audit) et verifier si chrome n'indique pas la compression gzip

mardi 15 juillet 2014

dovecot probleme


 diagnostique le problème
 tail -f /var/log/mail     

 test la connection par telnet et non ssh

telnet: > open imapserver.example.com imap telnet: Trying 192.0.2.2... telnet: Connected to imapserver.example.com. telnet: Escape character is '^]'. server: * OK Dovecot ready. client: a1 LOGIN MyUsername MyPassword server: a1 OK Logged in. client: a2 LIST "" "*" server: * LIST (\HasNoChildren) "." "INBOX" server: a2 OK List completed. client: a3 EXAMINE INBOX
 http://blog.andrewc.com/?p=15
 notice l’existence des a 

!! il se peut que la connexion avec des compt root ne marche pas 

créer un compte pour tester le serveur iamp
                                                                                                                                                                            
                                                                                                                                                                                                                                
                                                   

jeudi 10 juillet 2014

afficher et cacher des part du menu à vos visiteurs wordpress

compter le nombre d'un custom post expiré et afficher l'alerte dans l'admin bar



compter le nombre d'un custom post 'courrier' expiré et afficher l'alerte dans l'admin bar

si on utilise la methode avec wp_query on tombe dans un probleme lors de l'ajout d'un nouveau article courrier.

donc la solution est de passer par une requet sql direct

et attribuer la fonction à un hook

//////////////////////////////////////////////////////////////////



function sfn_show_expire(){
    global $wpdb;
$i=0;
$non_traite=0;
    $server_time = date('mdy');
    $result = $wpdb->get_results("SELECT * FROM wp_posts WHERE post_type = 'courrier' AND post_status = 'publish'");
    if( !empty($result)) foreach ($result as $a){
        $show_time = get_the_time('mdy', $a->ID );





$custom = get_post_custom($a->ID);
 $delai = $custom["delai"][0];
 $date_recu = $custom["Date"][0];
 $etat = $custom["etat"][0];
 $personne = $custom["personne"][0];
 //$date_recu = date("Y-m-d",$date_recu);
//increment 2 days
$date_expiration = strtotime( $date_recu."+".$delai." days");
$date_expiration = date("Y-m-d",$date_expiration );
$date_now=date("Y-m-d");//date actuelle
 $Objet = $custom["Objet"][0];





        if ($date_now>$date_expiration || $date_now==$date_expiration ){


$i++;
            if( $etat=='Non traité'){$non_traite++;}

        }
    } // end foreach

 global $wp_admin_bar;
/* $args = array(
        'id' => 'mbe_testimonials_pending',
        'href' => admin_url('./extranet/?page_id=939', 'http'),
        'parent' => 'top-secondary'
    );*/
if($non_traite > 0) $disp2=':<span class="mbe-ab-text" style="
    color: red;
" >'.$non_traite.' '.'messages non traités</span>';



        $display = '<a href="/extranet/?page_id=939"><span class="mbe-ab-text" style="
    color: yellow;
" >'.' Alerte'.' '.$i.' '.' courriers expirés</span>'.' '.$disp2.'</a>';

 $args['title'] = $display;
    $wp_admin_bar->add_node($args);

}

add_action('wp_before_admin_bar_render', 'sfn_show_expire', 999);

vendredi 6 juin 2014

des 'commande' mysql

1-connexion à la base :

mysql -h localhost -u 'utilsateur' -p 'en cas de mot de passe'  + 'nom de la base'

peut etre racourci à

mysql -h localhost -u root  (connexion a la database par defaut sans mot de passe)

voir les database :
show databases
    -> ;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| tesgtt               |
| yugts                |
+--------------------+
3 rows in set (0.06 sec)

 pour changer la database utilisé
use 'nom database'

pour créer database

create database 'nom'

create user

changement de mot de passe mysql :

SET PASSWORD FOR 'utilisateur'@'localhost' = PASSWORD('*****');

attribution des droits :

GRANT ALL PRIVILEGES ON nomdelabase.* TO 'utilisateur'@'localhost'  

lundi 28 avril 2014

creer un custom category type et utiliser wp_dropdown_categories menu pour lister les valeur

1- dans function.php

définiser la nouvelle taxonomy :



add_action( 'init', 'addresse_init' );

function addresse_init() {
// create a new taxonomy

$labels = array(

'name' => __( 'adr Categories', APP_TD ),

'singular_name' => __( 'Annonce Category', APP_TD ),

'search_items' => __( 'Search Annonce Categories', APP_TD ),

'all_items' => __( 'All Categories', APP_TD ),

'parent_item' => __( 'Parent Annonce Category', APP_TD ),

'parent_item_colon' => __( 'Parent Annonce Category:', APP_TD ),

'edit_item' => __( 'Edit Annonce Category', APP_TD ),

'update_item' => __( 'Update Annonce Category', APP_TD ),

'add_new_item' => __( 'Add New Annonce Category', APP_TD ),

'new_item_name' => __( 'New Annonce Category Name', APP_TD ),

'add_or_remove_items' => __( 'Add or remove Annonce categories', APP_TD ),

'menu_name' => __( 'adr', APP_TD ),

);



$args = array(

'labels' => $labels,

'public' => true,

'show_in_nav_menus' => true,

'show_ui' => true,

'show_tagcloud' => false,

'hierarchical' => true,



'query_var' => true,

'rewrite' => array( 'slug' => 'listings/category', 'with_front' => false ),

);



register_taxonomy( VA_LISTING_ADDRESSE, VA_LISTING_PTYPE, $args );
}


2-dans la page que vous voulez appeler le dropdwon :

<div class="form-field">
<?php wp_dropdown_categories( array(
    'walker'=> new SH_Walker_TaxonomyDropdown(),
'taxonomy' => VA_LISTING_ADDRESSE,
'hide_empty' => false,
'hierarchical' => true,
'name' => VA_LISTING_ADDRESSE,
/* 'selected' => $listing->category,*/
'show_option_none' => __( 'Selectionner une Cat&eacute;gorie', APP_TD ),
'class' => 'required',
'orderby' => 'id',
'value'=>'slug'

//'id' => 'ba3333'.$taxonomy

  ) ); ?>
 </div>

lundi 21 avril 2014

category group list get slug instead id

pour avoir un slug dans un url au lieu de id qui ne donne pas de resultat
have to resolve


http://stackoverflow.com/questions/14078572/how-to-change-value-for-options-and-select-in-wp-dropdown-categories

vendredi 11 avril 2014

facebook pagination wordpress problem

http://www.shayatik.com/2014/03/facebook-plugin-breaks-wordpress-pagination/#comment-41

best sol is :

When does pagination issue by Facebook WordPress plugin appears?

  • Only on homepage
  • If you are using “Post name” option in Permalink Settings
  • If you are using “Static” homepage option in your Reading Settings which means you are using some custom page template to display your posts in a default loop
The problem with this issue is that WordPress actually generates proper pagination link, (i.e. yourwebsite.com/page/2), but it is somehow always redirected to your home page.

Solution

This handy snippet should do a trick. Make sure it is included somewhere in thefunctions.php file of your theme.
/* Fix pagination issue caused by Facebook plugin */

function meks_fb_plugin_pagination_fix() {

  //Check if plugin is activated and if we are on the homepage
  if(class_exists('Facebook_Loader') && is_front_page()){
    global $wp_query;
    $page = get_query_var('page');
    $paged = get_query_var('paged');

    //Check if we are trying to reach pagination link
    if($page > 1 || $paged > 1){
      unset($wp_query->queried_object);
     }

  }

}

add_action( 'wp', 'meks_fb_plugin_pagination_fix', 99 );

wordpress popup


modification pour changer le popup de wordpress

install

Shutter Reloaded Plus plugin

and pour desactiver le popup de vtge j'ai desactivi le script jquery.colorbox-min.jsx



D:\public_html\wp-content\themes\vantage\includes\controllers.php
wp_enqueue_script(
'colorbox',
get_template_directory_uri() . '/scripts/jquery.colorbox-min.js',
array( 'jquery' ),
'1.3.19'
);

jeudi 10 avril 2014

surcharger l'affichage de wordpress add_action

le code original
<?php
/**
* Fires following the 'Password' field in the login form.
*
* @since 2.1.0
*/
do_action( 'login_form' );
?>

pour le charger dans le plugin on utilise

add_action('login_form', 'fction');

et on defini le code à ajouter dans la fct fction

exp pour ajouter un affichage à l'affichage original 

mardi 8 avril 2014

lundi 24 février 2014

wordpress


A hook, named wp_head, that runs just before the </head> tag is present in most themes, so we can just set our function to run wheneverwp_head runs, like so:
add_action("wp_head", "awepop_add_view")


 <?php add_filter$tag$function_to_add$priority$accepted_args ); ?> 

Example

The filter img_caption_shortcode is applied in media.php using the following call:
// Allow plugins/themes to override the default caption template.
$output = apply_filters('img_caption_shortcode', '', $attr, $content);
if ( $output != '' )
 return $output;
The target filter function will be called with three arguments:
  • '' <= This is normally the value the filter will be modifying
  • $attr
  • $content
/////////////////////
  • archive-{post_type}.php
  • single-{post_type}.php
archive-{post_type}.php 
If your custom post type were 'product', and/or query_var = "product", WordPress would look for archive-product.php to display the archive of posts.
single-{post_type}.php 
If your custom post type were 'product', and/or query_var = "product", WordPress would look for single-product.php to display the single or permalink of the post.
If these files are not available in your Theme's directory WordPress will look for archive.php and single.php, respectively. If even these files are not present it will default to index.php.
/////////////////

   comments_template( '', true ); //pour afficher les commentaires et le plugin de facebook comment
 
into single-post

vendredi 21 février 2014

redirection wordpress


dans controller.php
function template_include( $path ) {
if ( !current_user_can( 'edit_listings' ) ){
//return locate_template( 'create-listing-no-auth.php' );
 wp_redirect( '/wp-login-toadd-annonce.php' );
exit();

}

page/2 uo paged=2

problème dfe permalik et des pages précdents et suivantes:

l'url des pages se transforme en page/2 or en utilisant permalink /nom... ca ne march e pas donc
j'ai du changer dans general-template.php

pour forcer les numéro de pages

i.com/?paged='. $next_page_badr . '">' . $next_text . '</a>';

jeudi 20 février 2014

.net data base connexion mysql

there is 2 ways with Vs to connect to a database
1-use odbc
2-.net provider
http://stackoverflow.com/questions/4235291/how-to-connect-to-a-mysql-data-source-in-visual-studio

dimanche 16 février 2014

wordpress custom redirection

function va_redirect_to_front_page() {
    if (isset($_GET['redirect_to'])) {
if($_GET['redirect_to']=="crer-annonce-2")
         wp_redirect( 'crer-annonce-2' );
else
wp_redirect( $_GET['redirect_to'] );
        exit();
    }
else
wp_redirect( 'dashboard' );
exit();
}

creat this funciton in theme/includes/core
don't forget to add action

change max pic uploaded or featured (vantage)

dans /vantage/function.php
chnage this values
define( 'VA_MAX_FEATURED', 5 );
define( 'VA_MAX_IMAGES', 5 );

Get Related Posts For Custom Post Type By Category

how to get related post with custom ones :

http://isabelcastillo.com/get-related-posts-custom-taxonomy-category

mercredi 5 février 2014

Comment activé MobileZone et MMS pour cartes SIM Maroc Telecom

un message SMS au numéro 505 contient: CONFIG
Vous recevrez des lettres à votre téléphone mobile
Un message vous demandera d'entrer votre code PIN
Entrez 0000 et ensuite enregistrer les paramètres par défaut
Ensuite, éteignez votre téléphone mobile et redémarrer

mercredi 29 janvier 2014

lundi 27 janvier 2014

android activity restart after screen when the screen orientation change

you need to add
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|touchscreen">
to your android manifest
as explained in android forum :
http://developer.android.com/guide/topics/manifest/activity-element.html




android:configChanges
Lists configuration changes that the activity will handle itself. When a configuration change occurs at runtime, the activity is shut down and restarted by default, but declaring a configuration with this attribute will prevent the activity from being restarted. Instead, the activity remains running and itsonConfigurationChanged() method is called.

Nombre total de pages vues