Community Support Forums — WordPress® ( Users Helping Users ) — 2011-08-08T14:54:52-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=10358 2011-08-08T14:54:52-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10358&p=30203#p30203 <![CDATA[Re: Breaks Theme running in MAMP enviornment]]>

Statistics: Posted by Cristián Lávaque — August 8th, 2011, 2:54 pm


]]>
2011-08-08T10:58:20-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10358&p=30173#p30173 <![CDATA[Re: Breaks Theme running in MAMP enviornment]]> an update to the theme worked. FYI, here is what the theme developer wrote:

It was found the affected part in Folioway was the classes loading process that using the PHP native function __autoload(), and the function stopped working with several plugins for unknown reason.

Here a custom classes loading function was introduced to replace the native one in Folioway version 1.1.8, upgrade your Folioway to this latest version and your conflict issue gone


thanks for everyones help!

P

Statistics: Posted by ptoledo1 — August 8th, 2011, 10:58 am


]]>
2011-08-04T13:09:38-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10358&p=29864#p29864 <![CDATA[Re: Breaks Theme running in MAMP enviornment]]>
Here is the itools php file from the theme that seems to be spitting out the error. Thanks for taking a look! I really appreciate the time and attention,

P

Code:
<?php

    function iwak_var_dump($arr) {
        $retStr = '<ul>';
        if (is_array($arr)){
            foreach ($arr as $key=>$val){
                if (is_array($val)){
                    $retStr .= '<li>' . $key . ' => ' . iwak_var_dump($val) . '</li>';
                }else{
                    $retStr .= '<li>' . $key . ' => ' . $val . '</li>';
                }
            }
        }
        $retStr .= '</ul>';
        echo $retStr;
    }
   
    function iwak_array_merge ( array &$array1, array &$array2 )
    {
        $merged = $array1;
   
        foreach ( $array2 as $key => &$value )
        {
            if ( is_array ( $value ) && isset ( $merged [$key] ) && is_array ( $merged [$key] ) )
                $merged [$key] = iwak_array_merge ( $merged [$key], $value );
            else
                $merged [$key] = $value;
        }
   
        return $merged;
    }
   
    function iwak_array_unique($root_array) {
        if(!is_array($root_array))
               return $root_array;

        foreach ($root_array as &$child_array){
            $child_array=serialize($child_array);
        }

        $root_array=array_unique($root_array);

        foreach ($root_array as &$child_array){
            $child_array=unserialize($child_array);
        }

        return $root_array;
    }

    function iwak_get_options() {
        $cache = wp_cache_get(IWAK_OPTIONS, THEME_NAME);
        if(!is_array($cache)) {
            $cache = get_option(IWAK_OPTIONS);
            if(!empty($cache))
                wp_cache_add(IWAK_OPTIONS, $cache, THEME_NAME);
        }
       
        return $cache;
    }
   
    function iwak_default_options() {
        global $ikd;
        return $ikd;
    }
   
    function iwak_get_sidebar($name=null, $default=true) {
        global $iks;
        $iks->get_sidebar($name, $default);
    }
   
    function iwak_get_list($type) {
        global $iwak_cache;
       
        if(!isset($iwak_cache))
            $iwak_cache = new iWaK_Cache();
       
        switch($type) {
            case 'link_categories':
                $method = 'get_link_categories';
                break;
            case 'widget_areas':
                $method = 'get_widget_areas';
                break;
            case 'featured_posts':
                $method = 'get_featured_posts';
                break;
            case 'sticky_posts':
                $method = 'get_sticky_posts';
                break;
            case 'post_types':
                $method = 'get_ptypes_list';
                break;
            case 'category':
                $method = 'get_category_list';
                break;
            case 'tag':
                $method = 'get_tag_list';
                break;
            default:
                // Need to be optimized for a common operation thus do not have to add a 'case' whenever there is a new type of request
                if(taxonomy_exists($type))
                    $method = 'get_term_list';
                elseif(post_type_exists($type))
                    $method = 'get_post_list';
                $parameter = $type;
                break;
            // default:
                // $method = 'get_'. $type. '_list';
                // break;
        }
           
        if(!method_exists($iwak_cache, $method))
            return;
           
        return isset($parameter) ? $iwak_cache->$method($parameter) : $iwak_cache->$method();
    }

    function i_scandir($path) {
        if (function_exists(scandir)) {
            return scandir($path);
        }
        else {
            $dh = opendir($path);
            while (false !== ($filename = readdir($dh))) {
                $files[] = $filename;
            }
            closedir($dh);
            return $files;
        }
    }

    function showinfo($info) {
        echo '<script type="text/javascript">alert("'. $info. '")</script>';
    }
   
    //get sub string
    function i_substr($input, $start, $length, $end='...')  {
   
        $text = substr($input, $start, $length);
        $len = strlen($text);
       
        if( $len < $length ) return $text;
       
        if( $len > 0 && !seems_utf8($text[$len - 1]) ) {
       
            for( $i=0; $i>-3; $i--) {
           
                if( $len < 3 ) return '';
               
                if( !seems_utf8($text[$len - 3].$text[$len - 2].$text[$len - 1]) ) {
                    $len --;
                } else {
                    break;
                }
               
            }
           
        }

        if( $i != 0 )
            return substr($text, 0, $i). $end;
        else
            return $text. $end;
    }
       
    /**
     * Truncates text.
     *
     * Cuts a string to the length of $length and replaces the last characters
     * with the ending if the text is longer than length.
     *
     * @param string  $text String to truncate.
     * @param integer $length Length of returned string, including ellipsis.
     * @param string  $ending Ending to be appended to the trimmed string.
     * @param boolean $exact If false, $text will not be cut mid-word
     * @param boolean $considerHtml If true, HTML tags would be handled correctly
     * @return string Trimmed string.
    */
    function truncate($text, $length = 100, $ending = '', $removeImg = true, $exact = true, $considerHtml = true, $removeGallery = true) {
        if ($considerHtml) {
       
            // remove gallery shortcode
            //if($removeGallery) $text = preg_replace('/\[gallery[^\]]*\]/is', '', $text);
           
            // if the plain text is shorter than the maximum length, return the whole text
            if (strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {
                $text = preg_replace('/<\s*\/?div(\s.+?)?>/is', '', $text);
                //$text = preg_replace('/<\s*\/div\s*>/is', '', $text);
                if($removeImg) $text = preg_replace('/<\s*(img)(\s.+?)?>/is', '', $text);
                return $text;
            }
            // splits all html-tags to scanable lines
            preg_match_all('/(<.+?>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER);
            $total_length = 0;
            $open_tags = array();
            $truncate = '';
            foreach ($lines as $line_matchings) {
                // if there is any html-tag in this line, handle it and add it (uncounted) to the output
                if (!empty($line_matchings[1])) {
               
                    // exclude tag 'div' (f.e. <div ...>, </div>); and if $removeImg is true, exclude tag 'image' too (f.e. <img ... />)
                    if ( !preg_match('/^<!--more(.*?)?-->$/', $line_matchings[1]) && !($removeImg && preg_match('/^<\s*(img)(\s.+?)?>$/is', $line_matchings[1])) && !preg_match('/^<\s*\/?div(\s.+?)?>$/is', $line_matchings[1]) ) {
                   
                        // if it's an "empty element" with or without xhtml-conform closing slash (f.e. <br/>)
                        if (preg_match('/^<(\s*.+?\/\s*|\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\s.+?)?)>$/is', $line_matchings[1])) {
                            // do nothing
                        // if tag is a closing tag (f.e. </b>)
                        } else if (preg_match('/^<\s*\/([^\s]+?)\s*>$/s', $line_matchings[1], $tag_matchings)) {
                            // delete tag from $open_tags list
                            $pos = array_search($tag_matchings[1], $open_tags);
                            if ($pos !== false) {
                                unset($open_tags[$pos]);
                            }
                        // if tag is an opening tag (f.e. <b>)
                        } else if (preg_match('/^<\s*([^\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings)) {
                            // add tag to the beginning of $open_tags list
                            array_unshift($open_tags, strtolower($tag_matchings[1]));
                        }

                        // add html-tag to $truncate'd text
                        $truncate .= $line_matchings[1];
                    }
                }
                // calculate the length of the plain text part of the line; handle entities as one character
                $content_length = strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));
                if ($total_length+$content_length> $length) {
                    // the number of characters which are left
                    $left = $length - $total_length;
                    $entities_length = 0;
                    // search for html entities
                    if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE)) {
                        // calculate the real length of all entities in the legal range
                        foreach ($entities[0] as $entity) {
                            if ($entity[1]+1-$entities_length <= $left) {
                                $left--;
                                $entities_length += strlen($entity[0]);
                            } else {
                                // no more characters left
                                break;
                            }
                        }
                    }
                    $truncate .= i_substr($line_matchings[2], 0, $left+$entities_length);
                    // maximum lenght is reached, so get off the loop
                    break;
                } else {
                    $truncate .= $line_matchings[2];
                    $total_length += $content_length;
                }
                // if the maximum length is reached, get off the loop
                if($total_length>= $length) {
                    break;
                }
            }
        } else {
            if (strlen($text) <= $length) {
                return $text;
            } else {
                $truncate = i_substr($text, 0, $length - strlen($ending));
            }
        }
        // if the words shouldn't be cut in the middle...
        if (!$exact) {
            // ...search the last occurance of a space...
            $spacepos = strrpos($truncate, ' ');
            if (isset($spacepos)) {
                // ...and cut the text in this position
                $truncate = i_substr($truncate, 0, $spacepos);
            }
        }
        // add the defined ending to the text
        $truncate .= $ending;
        if($considerHtml) {
            // close all unclosed html-tags
            foreach ($open_tags as $tag) {
                $truncate .= '</' . $tag . '>';
            }
        }
        return $truncate;
    }
   
?>

Statistics: Posted by ptoledo1 — August 4th, 2011, 1:09 pm


]]>
2011-08-02T23:21:34-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10358&p=29716#p29716 <![CDATA[Re: Breaks Theme running in MAMP enviornment]]>
Otherwise, if this does NOT help you any, please ask the theme developer to contact us. We'll be happy to provide a free copy of both s2Member and s2Member Pro for them to test against. Please ask them to use this private contact form: http://www.s2member.com/contact/

Statistics: Posted by Jason Caldwell — August 2nd, 2011, 11:21 pm


]]>
2011-08-01T18:00:58-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10358&p=29590#p29590 <![CDATA[Re: Breaks Theme running in MAMP enviornment]]>

Could you post a copy of the file that spits the error here so Jason takes a look at their code? Where the 'iWaK_Cache' class is and itools.php where it tries to use it.

Statistics: Posted by Cristián Lávaque — August 1st, 2011, 6:00 pm


]]>
2011-08-01T12:31:58-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10358&p=29575#p29575 <![CDATA[Re: Breaks Theme running in MAMP enviornment]]>
Code:
Fatal error: Class 'iWaK_Cache' not found in /home1/halofdcc/public_html/mobiledemo/wp-content/themes/folioway/core/itools.php on line 75




'iWaK_Cache' is an essential class in Folioway, i don't know how and why it is not loaded (per the message you pasted) with your plugin. Please contact the plugin author first, i'd like to help if the author says the problem is on my theme, thanks!

Statistics: Posted by ptoledo1 — August 1st, 2011, 12:31 pm


]]>
2011-08-01T12:24:46-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10358&p=29573#p29573 <![CDATA[Re: Breaks Theme running in MAMP enviornment]]> Statistics: Posted by ptoledo1 — August 1st, 2011, 12:24 pm


]]>
2011-08-01T12:17:44-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10358&p=29572#p29572 <![CDATA[Re: Breaks Theme running in MAMP enviornment]]> Thanks. Yes, you're right. it's a conflict between the theme and S2 member. I can't even get into the theme once I enable it. I get a blank white screen. I have to go in and remove S2 Member from the plugins folder to get my theme back. Not sure where to go from here when it' a theme vs. plugin conflict - where to look an where to adjust is the question I suppose. Any advise would be be great.

Also, it's a MAMP environment so maybe that also throws another wrench into the situation as well. I haven't tested the theme and the plugin in a live environment. UPDATE: just tested on live environment, broke theme once I activated plugin as well, with this error:
Code:
Fatal error: Class 'iWaK_Cache' not found in /home1/halofdcc/public_html/mobiledemo/wp-content/themes/folioway/core/itools.php on line 75

Thanks!

P

Statistics: Posted by ptoledo1 — August 1st, 2011, 12:17 pm


]]>
2011-07-05T12:21:16-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10358&p=22405#p22405 <![CDATA[Re: Breaks Theme running in MAMP enviornment]]> http://www.s2member.com/options-page-di ... ing-video/

Statistics: Posted by Cristián Lávaque — July 5th, 2011, 12:21 pm


]]>
2011-07-05T07:33:43-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10358&p=22386#p22386 <![CDATA[Re: Breaks Theme running in MAMP enviornment]]> Thanks for the reply, I really appreciate it. I didn't get right back to you because I was out for the holidays.

The local environment is indeed running from a http://localhost environment. s2member works just fine with another theme in the same MAMP install and set up. The problem happens when I enable the plugin. Everything goes white. I can't access any pages, even the admin page. I have to go in and manually delete the plugin for my Wordpress install to be accessible again.

Now, I can get s2member to work on the default WP theme in the same environment, no problem. And I can get the theme to work in the same environment. It only happens when I try and get the two to play together.

Any other thoughts or suggestions would be great. Not sure if WP generates error logs. if it does, and someone points me to thme, I can post when I go back in and activate the plugin which brings up the white screen.

P

Statistics: Posted by ptoledo1 — July 5th, 2011, 7:33 am


]]>
2011-07-01T22:28:38-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10358&p=22061#p22061 <![CDATA[Re: Breaks Theme running in MAMP enviornment]]> /wp-config.php file:

Code:
define("LOCALHOST", true);  


s2Member has a special routine, which we refer to as the Systematics Routine. It sees your IP address is the same as the server's IP; which is sometimes an issue on a WAMP/MAMP installation. It's fine so long as your domain is http://localhost/. However, if it's something other than that, you'll need to add that line in your /wp-config.php file so s2Member realizes it's running on a localhost installation.

I don't know if it has anything to do with your theme, but I thought I'd mention it since you're using MAMP.

Now, when you say the theme breaks, could you explain what you mean? Do you have a screenshot? Do you get errors?

Statistics: Posted by Cristián Lávaque — July 1st, 2011, 10:28 pm


]]>
2011-07-01T13:33:32-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10358&p=22041#p22041 <![CDATA[Breaks Theme running in MAMP enviornment]]> I recently purchased this theme:
http://themeforest.net/item/folioway-pr ... eme/234219
and I really like it but I need s2member plugin to make it work for me. Problem is, everytime I enable the s2plugin it breaks the theme and gives me the "white screen of death." I'm running a local version of WP on MAMP/Mac enviornment. The theme works before I upload the plugin, breaks after I activate it, then works when I manually remove plugin. The plugin works on default themes that come with wordpress, which tells me it can work in a MAMP environment. I inquired with the theme owners and they didnt' feel that it was the theme that was bad but the plugin was doing something funky to it. They said that they'd work towards a solution if s2 community can figure out a problem with their theme. In any case, anyone have similar experience or recommendations? Not sure what other information to post, so if there is some tech info. that might help here, let me know and i'll post it. thanks for reading!
P

Statistics: Posted by ptoledo1 — July 1st, 2011, 1:33 pm


]]>