Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • @bigshow, you’re welcome.

    @jw Themes take a little look, the DOCUMENT is RTL, but the jcaroussel is LTR.

    Based on the doc found in :
    https://sorgalla.com/jcarousel/docs/reference/configuration.html#rtl

    You, maybe, must add the option :

    $('.jcarousel').jcarousel({
        rtl: true
    });

    in the file “js/jcarousel.responsive.js

    i just tested it in internet explorer 11, there is an option that can let us choose between “rtl” or “ltr” direction, and the jcarousel is ok when the direction is right to left.
    https://www.hostingpics.net/viewer.php?id=584621ie11.jpg

    @mahommed, please tell us what is :
    1) Your WordPress Installation version
    2) All the plugins you use (simple, at the homepage “view source” and copy all text between

    <head>

    and

    </head>

    )
    3) The name(s) of the browser(s) used for test.
    4) Look if you use similar CSS identifiers in other scripts.

    Thread Starter phpcore

    (@phpcore)

    Just one thing for users, we can use the tag (exists in the new release) :

    slider_notitle<
    within the shortcode directly to remove the title from the carousel (the title is the same as the name, sometimes we don’t need to include it)

    example :

    [jw_easy_logo slider_name="sponsors" slider_notitle=1]

    Developers should add the condition to the Widget part, the condition is :

    <?php if(!isset($atts['slider_notitle'])) { ?>
      <p class="jw_easy_slider_name">
    <?php if(isset($atts['slider_title']))
            echo $atts['slider_title'];
           else
            echo $atts['slider_name'];?>
       </p>
    <?php } ?>

    ??

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Thread Starter phpcore

    (@phpcore)

    @jw Themes, you’re welcome ??

    Thread Starter phpcore

    (@phpcore)

    @kamal Karki, you’re welcome ??

    Thread Starter phpcore

    (@phpcore)

    Within “init.php” add this function :

    function randomStr($length = 6){
      $validCharacters = "0123456789abcdefghijklmnopqrstuxyvwzABCDEFGHIJKLMNOPQRSTUXYVWZ";
      $validCharNumber = strlen($validCharacters);
      $result = "";
      for ($i = 0; $i < $length; $i++) {
       $index = mt_rand(0, $validCharNumber - 1);
       $result .= $validCharacters[$index];
      }
      return $result;
    }

    For the normal shortcode the action should be:

    /*start of shortcode*/
    add_shortcode('jw_easy_logo',function($atts){
      //add shortcode
      ob_start();
      $randomStr = randomStr();
    ?>
        <div class="wrapper">
            <?php if(!isset($atts['slider_notitle'])) { ?>
            <p class="jw_easy_slider_name"><?php if(isset($atts['slider_title'])) echo $atts['slider_title']; else echo $atts['slider_name'];?></p>
             <?php } ?>
            <div class="jcarousel-wrapper" id="<?php echo trim($select_no).$randomStr;?>">
                <div class="jcarousel">
                    <ul>
                    <?php
                    global $wpdb;
    
                    $rw = $wpdb->get_results("SELECT * from ".$wpdb->prefix."jw_easy_logo_slider INNER JOIN ".$wpdb->prefix."jw_easy_logo_slider_setting where ".$wpdb->prefix."jw_easy_logo_slider_setting.id = "."".$wpdb->prefix."jw_easy_logo_slider.slider_id"." AND ".$wpdb->prefix."jw_easy_logo_slider_setting.name='".$atts['slider_name']."'");
    
                    foreach ($rw as $setting){  $res=$setting->setting; $show=unserialize($res);}
    
                    $rows = $wpdb->get_results("SELECT * from ".$wpdb->prefix."jw_easy_logo_slider INNER JOIN ".$wpdb->prefix."jw_easy_logo_slider_setting where ".$wpdb->prefix."jw_easy_logo_slider_setting.id = "."".$wpdb->prefix."jw_easy_logo_slider.slider_id"." AND ".$wpdb->prefix."jw_easy_logo_slider_setting.name='".$atts['slider_name']."'");
    
                    foreach ($rows as $row ){?>
                        <li>
    						 <style>
                            	.easy-logo_image {height:<?php if($show['image_ht']!=''){echo $show['image_ht'];}else{ echo "150px";}?> !important}
                             </style>
    
                           <?php if($row->url!=''){?>
                             <a href="<?php echo $row->url;?>" target="<?php if($show['url_target']!=''){echo $show['url_target'];} else{ echo "_blank";} ?>" title="<?php echo stripcslashes($row->title);?>">
                              <img src="<?php echo plugins_url('inc/images/'.$row->image,__FILE__);?>" class="easy-logo_image" alt="" title="<?php echo stripcslashes($row->title);?>" />
                             </a>
                           <?php } else{?>
                             <img src="<?php echo plugins_url('inc/images/'.$row->image,__FILE__);?>" class="easy-logo_image" alt="" title="<?php echo stripcslashes($row->title);?>" />
                           <?php }?>
    
                           <?php if($row->url!=''){?>
                             <a href="<?php echo $row->url;?>" target="<?php if($show['url_target']!=''){echo $show['url_target'];} else{ echo "_blank";} ?>" title="<?php echo stripcslashes($row->title);?>">
                              <p><?php if($show['jw_easy_logo_slider_title_sh']!="hide" AND $show['jw_easy_logo_slider_title_sh']!=''){echo stripcslashes($row->title);}?></p>
                             </a>
                           <?php } else {?>
                             <p><?php if($show['jw_easy_logo_slider_title_sh']!="hide" AND $show['jw_easy_logo_slider_title_sh']!=''){echo stripcslashes($row->title);}?></p>
                           <?php }?>
    
                             <?php $str = substr($row->description, 0, $show['limit_description']);?>
                             <?php if($show['jw_easy_logo_slider_desc_sh']!="hide" AND $show['jw_easy_logo_slider_title_sh']!=''){echo '<p class="descp">'.stripcslashes($str).'</p>';}?>
    
                        </li>
                        <?php }?>
                    </ul>
                </div>
                <a href="#" class="jcarousel-control-prev" title="Précédent">&lsaquo;</a>
    
                <a href="#" class="jcarousel-control-next" title="Suivant">&rsaquo;</a>
    
                <p class="jcarousel-pagination"></p>
    
            </div>
            <script type='text/javascript'>create_jcarousel('<?php echo trim($select_no).$randomStr;?>');</script>
        </div>
      <?php return ob_get_clean();?>
    
    <?php });

    The part of code for Widget should be:

    <?php
    	public function widget($args,$instance){
    
    		extract($args);
    
    		extract($instance);
    
            $randomStr = randomStr();
    
    		echo $before_widget;
    ?>
    
            <div class="wrapper">
    
                <<?php echo $htmltag;?>><?php echo $title;?></<?php echo $htmltag;?>>
    
                <div class="jcarousel-wrapper" id="<?php echo trim($select_no).$randomStr;?>">
                    <div class="jcarousel">
                        <ul>
                         <?php
    
    					global $wpdb;
    
    				$rw = $wpdb->get_results("SELECT *from ".$wpdb->prefix."jw_easy_logo_slider JOIN ".$wpdb->prefix."jw_easy_logo_slider_setting where
    
    				".$wpdb->prefix."jw_easy_logo_slider_setting.name='".$select_no."'");
    
    				foreach ($rw as $setting){  $res=$setting->setting; $show=unserialize($res);}
    
    					$rows = $wpdb->get_results("SELECT * from ".$wpdb->prefix."jw_easy_logo_slider JOIN ".$wpdb->prefix."jw_easy_logo_slider_setting where ".$wpdb->prefix."jw_easy_logo_slider_setting.id = "."".$wpdb->prefix."jw_easy_logo_slider.slider_id"." AND ".$wpdb->prefix."jw_easy_logo_slider_setting.name='".$select_no."'");
    
    					foreach ($rows as $row ){?>
    
                            <li>
    						 <style>
                            	.easy-logo_image {height:<?php if($show['image_ht']!=''){echo $show['image_ht'];}else{ echo "150px";}?> !important}
                             </style>
    
                           <?php if($row->url!=''){?>
                             <a href="<?php echo $row->url;?>" target="<?php if($show['url_target']!=''){echo $show['url_target'];} else{ echo "_blank";} ?>" title="<?php echo stripcslashes($row->title);?>">
                              <img src="<?php echo plugins_url('inc/images/'.$row->image,__FILE__);?>" class="easy-logo_image" alt="" />
                             </a>
                           <?php } else{?>
                             <img src="<?php echo plugins_url('inc/images/'.$row->image,__FILE__);?>" class="easy-logo_image"  alt="" title="<?php echo stripcslashes($row->title);?>" />
                           <?php }?>
    
                           <?php if($row->url!=''){?>
                             <a href="<?php echo $row->url;?>" target="<?php if($show['url_target']!=''){echo $show['url_target'];} else{ echo "_blank";} ?>" title="<?php echo stripcslashes($row->title);?>">
                              <p><?php if($show['jw_easy_logo_slider_title_sh']!="hide" AND $show['jw_easy_logo_slider_title_sh']!=''){echo stripcslashes($row->title);}?></p>
                             </a>
                           <?php } else {?>
                             <p><?php if($show['jw_easy_logo_slider_title_sh']!="hide" AND $show['jw_easy_logo_slider_title_sh']!=''){echo stripcslashes($row->title);}?></p>
                           <?php }?>
    
                           <?php $str = substr($row->description, 0, $show['limit_description']);?>
    
                            <?php if($show['jw_easy_logo_slider_desc_sh']!="hide"){echo '<p>'.stripcslashes($str).'</p>';}?>
    
                            </li>
    
                            <?php }?>
    
                        </ul>
    
                    </div>
    
                    <a href="#" class="jcarousel-control-prev" title="Précédent">&lsaquo;</a>
    
                    <a href="#" class="jcarousel-control-next" title="Suivant">&rsaquo;</a>
    
                    <p class="jcarousel-pagination"></p>
                </div>
                <script type='text/javascript'>create_jcarousel('<?php echo trim($select_no).$randomStr;?>');</script>
            </div>
    
    		<?php echo $after_widget;
    	}
    ?>

    The Javascript function “create_jcarousel(id)” :

    function create_jcarousel(id){
     var ID = '#'+id;
     jQuery.noConflict();
     jQuery(document).ready(function($) {
    
        $(function() {
    
            var jcarousel = $(ID + ' .jcarousel');
    
            jcarousel
    
                .on('jcarousel:reload jcarousel:create', function () {
    
                    var width = jcarousel.innerWidth();
    
                    if (width >= 1100) {
    
                        width = width / 8;
    
                    } else if (width >= 992) {
    
                        width = width / 6;
    
                    } else if (width >= 768) {
    
                        width = width / 5;
    
                    } else if (width >= 600) {
    
                        width = width / 4;
    
                    } else if (width >= 480) {
    
                        width = width / 3;
    
                    }else if (width >= 320) {
    
                        width = width / 2;
    
                    }else if (width < 320) {
    
                        width = width / 1;
                    }
    
                    jcarousel.jcarousel('items').css('width', width + 'px');
                })
    
                .jcarousel({
    
                    wrap: 'circular'
    
                });
    
            $(ID + ' .jcarousel-control-prev')
    
                .jcarouselControl({
    
                    target: '-=1'
    
                });
    
            $(ID + ' .jcarousel-control-next')
    
                .jcarouselControl({
    
                    target: '+=1'
    
                });
            /*
            //if more than 10 logos, the links break into many rows :(
    
            $(ID + ' .jcarousel-pagination')
    
                .on('jcarouselpagination:active', 'a', function() {
    
                    $(this).addClass('active');
    
                })
    
                .on('jcarouselpagination:inactive', 'a', function() {
    
                    $(this).removeClass('active');
    
                })
    
                .on('click', function(e) {
    
                    e.preventDefault();
    
                })
    
                .jcarouselPagination({
    
                    perPage: 1,
    
                    item: function(page) {
    
                        return '<a href="#' + page + '">' + page + '</a>';
    
                    }
    
                });
            */
    		$(ID + ' .jcarousel').jcarouselAutoscroll({
    
       			 interval: 2500,
    
    			create: $(ID + ' .jcarousel').hover(function(){
    				$(this).jcarouselAutoscroll('stop');
    			},
    			function(){
    				$(this).jcarouselAutoscroll('start');
    			})
    		});
    
        });
    
     });
    }
    phpcore

    (@phpcore)

    No you can’t

    phpcore

    (@phpcore)

    how the hell can you verify that : 500 queries ?

    phpcore

    (@phpcore)

    First add an option in the back-end panel (admin). We should edit the file “settings-options.php” (for me, I’m using webuilder 2011 to edit php files, you can try notepad plus, it highlights the code and you can see lines numbers).
    Locate the function : function wpuf_settings_fields() { … }
    you can view this part of the code :

    array(
    ‘name’ => ‘attachment_max_size’,
    ‘label’ => __( ‘Attachment max size’, ‘wpuf’ ),
    ‘desc’ => __( ‘Enter the maximum file size in <b>KILOBYTE</b> that is allowed to attach’, ‘wpuf’ ),
    ‘type’ => ‘text’,
    ‘default’ => ‘2048’
    ),

    You can duplicate this part like this :

    array(
    ‘name’ => ‘attachment_max_size’,
    ‘label’ => __( ‘Attachment max size’, ‘wpuf’ ),
    ‘desc’ => __( ‘Enter the maximum file size in <b>KILOBYTE</b> that is allowed to attach’, ‘wpuf’ ),
    ‘type’ => ‘text’,
    ‘default’ => ‘2048’
    ),
    array(
    ‘name’ => ‘attachment_max_size’,
    ‘label’ => __( ‘Attachment max size’, ‘wpuf’ ),
    ‘desc’ => __( ‘Enter the maximum file size in <b>KILOBYTE</b> that is allowed to attach’, ‘wpuf’ ),
    ‘type’ => ‘text’,
    ‘default’ => ‘2048’
    ),

    Now we need to modify some things in the second block :

    array(
    ‘name’ => ‘attachment_allowed_files’,
    ‘label’ => __( ‘Allowed files’, ‘wpuf’ ),
    ‘desc’ => __( ‘Enter here the extensions of the allowed files. By default enter “*” (without the double quotes), this means allow all files’, ‘wpuf’ ),
    ‘type’ => ‘text’,
    ‘default’ => ‘*’
    ),

    Now we have finished with the option of allowed files in the admin panel.

    Now we should modify another file, in order to have the effect of this option on the front-end.

    In the Installation folder of the plugin, locate a folder named “lib”, inside edit the file named “attachment.php”

    Locate the line :

    $attachment_enabled = wpuf_get_option( ‘allow_attachment’ );

    Duplicate it so we need to have :

    $attachment_enabled = wpuf_get_option( ‘allow_attachment’ );
    $attachment_enabled = wpuf_get_option( ‘allow_attachment’ );

    We need to modify the second line :

    $attachment_enabled = wpuf_get_option( ‘allow_attachment’ );
    $attachment_allowed_files = wpuf_get_option( ‘attachment_allowed_files’ );

    Locate at the bottom of these lines this part of code :

    ‘filters’ => array(array(‘title’ => __( ‘Allowed Files’ ), ‘extensions’ => ‘*’)),

    We need to change the string ‘*’ by our new variable like this:

    ‘filters’ => array(array(‘title’ => __( ‘Allowed Files’ ), ‘extensions’ => $attachment_allowed_files)),

    Enjoy it !

    phpcore

    (@phpcore)

    Edit the file “post-expirator.php” and locate the function :
    function expirationdate_update_post_meta($id) {

    }

    then replace it by this one :

    function expirationdate_update_post_meta($id) {
    	if (!isset($_POST['expirationdate_formcheck']))
    		return false;
    
        $default = get_option('expirationdateDefaultDate',POSTEXPIRATOR_EXPIREDEFAULT);
    	if ($default == 'publish') {
    	        if(isset($_POST['mm']) && isset($_POST['jj']) && isset($_POST['aa']) && isset($_POST['hh']) && isset($_POST['mn'])){
     	         $month = $_POST['mm'];
            	 $day = $_POST['jj'];
    	         $year = $_POST['aa'];
            	 $hour = $_POST['hh'];
    	         $minute = $_POST['mn'];
                }
    	} else {
    	        if(isset($_POST['expirationdate_month']) && isset($_POST['expirationdate_day']) && isset($_POST['expirationdate_year']) && isset($_POST['expirationdate_hour']) && isset($_POST['expirationdate_minute'])){
    	         $month = $_POST['expirationdate_month'];
            	 $day = $_POST['expirationdate_day'];
    	         $year = $_POST['expirationdate_year'];
            	 $hour = $_POST['expirationdate_hour'];
    	         $minute = $_POST['expirationdate_minute'];
                }
    	}
    	$category = isset($_POST['expirationdate_category']) ? $_POST['expirationdate_category'] : 0;
    	if (isset($_POST['enable-expirationdate'])) {
    	        postExpiratorTimezoneSetup();
            	// Format Date
                if(isset($hour) && isset($minute) && isset($month) && isset($day) && isset($year))
            	 $ts = mktime($hour,$minute,0,$month,$day,$year);
                else
            	 $ts = time() + (24*60*60);//an error occured, so post will expires in 24 hours
    
            	// Update Post Meta
    		    delete_post_meta($id, '_expiration-date-category');
    		    delete_post_meta($id, 'expiration-date');
    	        update_post_meta($id, 'expiration-date', $ts);
    
            	$catEnabled = get_option('expirationdateCategory');
    	        if ((isset($category) && !empty($category)) && ($catEnabled === false || $catEnabled == 1)) {
    			if (!empty($category)) update_post_meta($id, '_expiration-date-category', $category);
    		}
    		update_post_meta($id, '_expiration-date-processed', 0);
    	} else {
    		delete_post_meta($id, 'expiration-date');
    		delete_post_meta($id, '_expiration-date-category');
    		delete_post_meta($id, '_expiration-date-processed');
    	}
    }

    With custom posts you can develop advanced themes

Viewing 13 replies - 1 through 13 (of 13 total)