test
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • mzamao Friend
    #182546

    1.
    jasocial_feed save_image

    How to create folder by date?
    Create a folder every day。
    Replace Fixed path ‘/images/jasocial_feed[/’

    For example:
    images/2012/11/24/ Replace ‘/images/jasocial_feed[/’
    images/2012/11/25/ Replace ‘/images/jasocial_feed[/’
    images/2012/11/26/ Replace ‘/images/jasocial_feed[/’
    And so on…..

    <Because godaddy single directory limit 1024 the number of files. >


    1. 5
    2. 2
    Luna Garden Moderator
    #474312

    Hello mzamao,

    In order to create folder by date, please go to this file:

    pluginsplg_system_jasocial_feedjasocial_feed.php
    change function saveImage by these follow:

    private function saveImage($url, $src, $caption = '', $alt = '') {
    if($this->save_image) {
    $dt = sprintf('/%d/%d/%d/', date('Y'), date('m'), date('d'));
    $folder = JPATH_ROOT.$dt;
    $result = JFolder::create($folder);
    if($result) {
    $filename = basename($url);
    $filename = preg_replace('/?.*?$/', '', $filename);
    $ext = JFile::getExt($filename);
    $ext = strtolower($ext);
    if($ext == 'php') $ext = 'jpg';
    $filename = md5($url).'.'.$ext;

    $file = $folder.$filename;

    if(!JFile::exists($file)) {
    if($src == 'facebook') {
    $validImg = $this->checkImgSize($url);
    if(!$validImg) {
    return false;
    }
    }

    $content = @file_get_contents($url);
    if($content) {
    $result = JFile::write($file, $content);
    if($result) {
    //update with local link
    $url = 'images'.$dt.$filename;
    }
    }
    return $this->getArticleImageObj($url, $caption, $alt, $src);
    } else {
    $url = 'images'.$dt.$filename;
    return $this->getArticleImageObj($url, $caption, $alt, $src);
    }
    }
    }

    if($src == 'facebook') {
    $validImg = $this->checkImgSize($url);
    } else {
    //image that get from twitter is checked before
    $validImg = true;
    }
    if($validImg) {
    return $this->getArticleImageObj($url, $caption, $alt, $src);
    } else {
    return false;
    }

    }

    Please try and let me know the results.

    mzamao Friend
    #474502

    Hello
    Solve the problem, very, very Thank you!!!!!
    Following the code you need to add the “/ images /” normal use,
    otherwise the wrong path, the picture can not be displayed!
    For example:
    *$ dt = sprintf (‘/ images /% d /% d /% d /’, date (‘Y’), date (‘m’), date (‘d’));
    =====================
    Another question

    jasocial_feed
    Run Now

    After ‘Run Now’ a few minutes
    Prompt:
    500 Internal Server Error

    Why?
    Server problems?
    Code issues?
    *keywords too much?


    1. 1
    2. 4
    Luna Garden Moderator
    #474506

    Hi,
    <em>@mzamao 348277 wrote:</em><blockquote>
    Following the code you need to add the “/ images /” normal use,
    otherwise the wrong path, the picture can not be displayed!
    For example:
    *$ dt = sprintf (‘/ images /% d /% d /% d /’, date (‘Y’), date (‘m’), date (‘d’));
    </blockquote>

    Yes, I have missed this line.

    <blockquote>Run Now
    After ‘Run Now’ a few minutes
    Prompt:
    500 Internal Server Error
    Why?
    Server problems?
    Code issues?
    *keywords too much?</blockquote>

    Maybe cause of the data fetching is so large, can you try to increase your memory_limit in php.ini file.

    And I want to know before changing the function saveImage, when you press ‘Run now’, it still works or not. If not please send me your admin account and FTP account for further check.

    mzamao Friend
    #474526

    Thank you very much!!!

    ============
    before changing the function save image,
    *when press ‘Run now’
    Can feed content!
    But the uncertainty is not all feed completed? ?

    ‘Run now’ , After a few minutes later , Error occurs
    *”500 Internal Server Error” …….

    =====
    Another question!!

    How to make the content is loaded in advance!
    Advance Loading, not rolled to the bottom of the load ,
    Do not scroll to the bottom of the page is loaded,。
    Been loaded, so users do not need to wait for the load, and will be able to directly browse!

    Luna Garden Moderator
    #475028

    <blockquote>before changing the function save image,
    *when press ‘Run now’
    Can feed content!
    But the uncertainty is not all feed completed? ?

    ‘Run now’ , After a few minutes later , Error occurs
    *”500 Internal Server Error” …….
    </blockquote>
    Maybe cause of the data fetching is so large, can you try to increase your memory_limit in php.ini file.

    <blockquote>How to make the content is loaded in advance!
    Advance Loading, not rolled to the bottom of the load ,
    Do not scroll to the bottom of the page is loaded,。
    Been loaded, so users do not need to wait for the load, and will be able to directly browse! </blockquote>

    It was how JA Wall works, and we can’t change the Loading content.

    Here the link for reference to increase number article load: http://www.joomlart.com/forums/topic/lazyload-problem-only-5-items-slow-nothing-without-mouse-movement/

Viewing 6 posts - 1 through 6 (of 6 total)

This topic contains 6 replies, has 2 voices, and was last updated by  Luna Garden 12 years, 1 month ago.

We moved to new unified forum. Please post all new support queries in our New Forum