Forum Replies Created

Viewing 15 replies - 1 through 15 (of 11,205 total)
  • Sorry about that. Please try the link again.

    The link below gives step by step instructions for migrating a WP site.

    https://wordpress.mcdspot.com/2012/08/22/migrating-a-wordpress-site-step-by-step/

    Switching themes worked on a second site.

    I had the same problem while using the Magazine Basic theme. Switched to TwentyEleven and was able to update on the first try.

    vtxyzzy

    (@vtxyzzy)

    One way would be to create a shortcode that uses a parameter to tell the current state. You could put the different lines of text into Custom Fields. That way the client could control everything by editing the Page.

    Thread Starter vtxyzzy

    (@vtxyzzy)

    An update: I duplicated the site on a different host and it works perfectly. I am closing this thread and pursuing a solution with 1and1.

    Thread Starter vtxyzzy

    (@vtxyzzy)

    I did turn on debugging and did not find anything.

    Thread Starter vtxyzzy

    (@vtxyzzy)

    Here is an updated version of the shortcode function. It corrects a few bugs and adds support for the ‘rows’ parameter.

    /* Modified version of [cn-social-icons] from Easy Social Icons plugin.
     *
     * Added all the parameters to the shortcode.  All parameters are optional.
     *
     * Description:  Returns an unordered list of icons and optional labels as
     *       defined in 'Easy Social Icon'->'Add Icons'.
     *
     * Usage: [cg_social_icons
     *          width=nn
     *          height=nn
     *          margin=nn
     *          rows=nn
     *          vertical=[yes|no]
     *          text_align=[left|center|right]
     *          labels=[yes|no]
     *          icons=[all|(csv list of icon titles)]
     *          class=[class_name]
     *       ]
     *
     * Parameters:
     *    width -
     *       The width in pixels for the icons. Example: width=16
     *       Default is the value set in 'Easy Social Icon'->Options.
     *
     *    height -
     *       The height in pixels for the icons. Example: height=16
     *       Default is the value set in 'Easy Social Icon'->Options.
     *
     *    margin -
     *       The margin is is the gap in pixels between the icons.
     *       Left and right margins will be set to 1/2 this value.
     *       Default is the value set in 'Easy Social Icon'->Options.
     *
     *    rows  -
     *       The number of rows of icons.
     *       Default is the value set in 'Easy Social Icon'->Options.
     *
     *    vertical -
     *       The vertical or horizontal display of the icons.
     *       If set to 'yes', the icons will be displayed vertically.
     *       If set to 'no', the icons will be displayed horizontally.
     *       Default is the value set in 'Easy Social Icon'->Options.
     *
     *    text_align  -
     *       Alignment of the icons.
     *       If set to 'left', the icons will be aligned left.
     *       If set to 'center', the icons will be aligned center.
     *       If set to 'right', the icons will be aligned right.
     *       Default is the value set in 'Easy Social Icon'->Options.
     *
     *    labels   -
     *       Option to print the Icon Title as a label for the icons.
     *       If set to 'yes', the labels will be printed.
     *       Default is 'no'.
     *
     *    icons -
     *       An optional comma separated list of Icon Titles to print.
     *       If specified, icons will be printed in the order listed.
     *       If omitted, or set to 'all', all icons will be printed in
     *       the order set in 'Easy Social Icon'->'Sort Icons'.
     *
     *    class -
     *       An optional class name to be added to the '<ul>' tag in
     *       addition to the class 'cnss-social-icon' which is always
     *       added.
     *       Default is none.
     *
     */
    function cg_social_icons_fn( $atts ) {
    
       global $wpdb,$baseURL;
    
    	$attrs = shortcode_atts( array(
    	   'width'        => get_option('cnss-width'),
    	   'height'       => get_option('cnss-height'),
    	   'margin'       => get_option('cnss-margin'),
    	   'rows'         => get_option('cnss-row-count'),
    	   'vertical'     => 'default',
    	   'text_align'   => get_option('cnss-text-align'),
    	   'labels'       => 'no',
    	   'icons'        => 'all',
    	   'class'        => '',
    	   ),
    	   $atts
    	);
    	extract( $attrs );
    	$width = intval($width);
    	$height = intval($height);
    	$margin = intval($margin);
    	$rows = intval($rows);
    	$vertical = strtolower($vertical);
    	$text_align = strtolower($text_align);
    	$labels = strtolower($labels);
    	$icons = strtolower($icons);
    
    	if ( $vertical == 'default' ) {
    	   $vorh = get_option('cnss-vertical-horizontal');
    	} else {
    	   $vorh = ($vertical == 'yes') ? 'vertical' : 'horizontal';
    	}
    	$text_align = ($text_align == 'right') ? 'right' : (($text_align == 'center') ? 'center' : 'left');
    	$labels = ($labels == 'yes') ? 'yes' : 'no';
    
    	// Convert icons list to csv for use in sql IN clause, if necessary
    
    	if ( $icons == 'all' ) {
    	   $post_title_sql = ' 1 = 1 ';
    	} else {
    	   $icon_names = explode( ',', $icons );
    	   $icon_names = array_map( 'trim', $icon_names );
    	   $icon_names_esc = array_map( 'esc_sql', $icon_names );
    	   $icon_list = '"' . implode( '","', $icon_names_esc) . '"';
    	   $post_title_sql = " LOWER(title) IN ( $icon_list ) ";
    	}
    
    	$table_name = $wpdb->prefix . "cn_social_icon";
    	$image_file_path = $baseURL;
    	$sql = "SELECT * FROM ".$table_name." WHERE $post_title_sql AND image_url<>'' AND url<>'' ORDER BY sortorder";
    	$video_info = $wpdb->get_results($sql);
    
    	$out = '';
    	if ( $video_info ) {
    		// Sort in order of icons parameter, if needed
    		if ( $icons != 'all' ) {
             usort($video_info, function($a, $b) use ($icon_names) {
                return array_search(strtolower($a->title), $icon_names) - array_search(strtolower($b->title), $icon_names); }
             );
          }
    
          $_collectionSize = count($video_info);
          $_rowCount = $rows ? $rows : 1;
          $_columnCount = ceil($_collectionSize/$_rowCount);
          $vorh = ($_columnCount == 1) ? 'vertical' : $vorh;
          $li_margin = round($margin/2);
    
          ob_start();
          $i=0;
          echo "\n" . '<ul class="cnss-social-icon ' . $class . '" style="text-align:'.$text_align.';">' . "\n";;
          foreach($video_info as $icon) {
    
             if ( $vorh == 'horizontal' && ((++$i % $_columnCount) == 1 || $_columnCount == 1)) {
                if ( $i > 1 ) {
                   echo "</ul>\n";
                   echo '<ul class="cnss-social-icon ' . $class . '" style="text-align:'.$text_align.';">' . "\n";
                }
             }
    		   if(strpos($icon->image_url,'/')===false) {
    		      $image_url = $image_file_path.'/'.$icon->image_url;
    		   } else {
    		      $image_url = $icon->image_url;
    		   }
    		   ?>
    		   <li class="<?php echo format_title($icon->title); ?>" style=" <?php echo $vorh=='horizontal'?'display:inline-block;':''; ?>">
    		      <a <?php echo ($icon->target==1)?'target="_blank"':'' ?> title="<?php echo $icon->title ?>" href="<?php echo esc_url($icon->url); ?>"><img src="<?php echo esc_url($image_url); ?>" border="0" width="<?php echo $width ?>" height="<?php echo $height ?>" alt="<?php echo $icon->title ?>" style=" <?php echo 'margin:'.$li_margin.'px;'; ?>" />
    		         <?php echo ($labels == 'yes') ? $icon->title : '';?>
    		      </a>
    		   </li><?php
    		   echo "\n"; // For source readability
    	   }
    	   echo "</ul>\n";
    	   $out = ob_get_contents();
    	   ob_end_clean();
    	}
    	return $out;
    }
    add_shortcode( 'cg-social-icons', 'cg_social_icons_fn' );
    Thread Starter vtxyzzy

    (@vtxyzzy)

    As I said in my initial post, support is enabled on the site: https://troop44bushkill.org/

    Thread Starter vtxyzzy

    (@vtxyzzy)

    I had already tried that before I created the first post.

    Thread Starter vtxyzzy

    (@vtxyzzy)

    I followed the steps in the guide, but the reference to wamp is still in the database. I believe that deleting uninstall.php prevents the options from being deleted, so there is no change.

    What can I do to remove the legacy options without losing the other options?

    Thread Starter vtxyzzy

    (@vtxyzzy)

    Thank you. Now anyone searching this support forum can see that the issue has been resolved.

    Thread Starter vtxyzzy

    (@vtxyzzy)

    Thanks. Now anyone searching the forum for this problem can see that it has been resolved.

    Thread Starter vtxyzzy

    (@vtxyzzy)

    Thanks. Now anyone searching the support forum can see that it has been resolved.

    @marcus, it would be good to mark this topic ‘Resolved’ so that others can see that there is a fix.

Viewing 15 replies - 1 through 15 (of 11,205 total)