-
AuthorPosts
-
matgray87 Friend
matgray87
- Join date:
- November 2011
- Posts:
- 159
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 33
- Thanked:
- 8 times in 1 posts
September 28, 2014 at 11:42 pm #201656Hi,
I am using the Social Feed plugin to bring in images from instagram into a category to be displayed here:
http://annings.mattgraydesign.co.uk/gallery/
When the content is imported from instagram, it comes with no date, as the information isn’t pulled in by the feed.
When being pulled in, the most recent instagram post is still given the latest ID, but all the date information is the same.
This is making it impossible for me to order the articles by date, so I need to order by ID, but that isn’t an option within the blog/portfolio layout.
Where can I override the article ordering so that the latest ID comes first?
Thanks,
MattNinja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
September 29, 2014 at 7:39 am #550958You can customize createdate or id of Instagram in plugins/system/jasocial_feed/jasocial_feed.php file
private function fetchInstagramPost ($profile) {
$igid = $this->getProperty($profile, 'instagram_account');
$target_com = $this->getProperty($profile, 'instagram_target', 'joomla');
$tableContent = $this->getTable($target_com, 0);
$catid = $this->getProperty($profile, 'instagram_'.$target_com.'_catid', 0);
if(!$tableContent || !$igid || !$catid) {
return false;
}$created_by = $this->getProperty($profile, 'instagram_created_by', 42);
$getImg = $this->getProperty($profile, 'instagram_getimg', 1);
$srcTxt = $this->getProperty($profile, 'instagram_sourcetxt', '(Source Instagram)');
$limit = $this->getProperty($profile, 'instagram_limit_post', 20);
$update_article = $this->getProperty($profile, 'instagram_update_article', 0);//override global settings
$this->save_image = $this->getProperty($profile, 'instagram_save_image', 0);
$this->valid_img_width = $this->getProperty($profile, 'instagram_valid_img_width', 360);
$this->valid_img_height = $this->getProperty($profile, 'instagram_valid_img_height', 180);//IMPORT PROCESS
$igKey = $igid.'_';$last_insert_id = isset($this->aInfo[$igKey.'ig_last_id']) ? $this->aInfo[$igKey.'ig_last_id'] : '';
$items = $this->getInstagramItems($igid, $limit);
$numResult = 0;
//$aResult = array();if(count($items)) {
$i = 0;
foreach ($items as $dt) {
$i++;/*if($dt->id == $last_insert_id && !$update_article) {
//remain posts are imported => skipable
break;
}*/$alias = JApplication::stringURLSafe('instagram-id-'.$dt->id);
$oldId = $tableContent->existsPost($alias);
if($oldId && !$update_article) {
continue;
}if($i == 1) {
$this->aInfo[$igKey.'ig_last_id'] = $dt->id;
}$title = $this->getPostTitle($dt->title);
$tcontent = $dt->title;$post = array();
$post['source_alias'] = $alias;
$post['source_title'] = $title;
$post['created_by'] = $created_by;
$post['source_author'] = $dt->author;
$post['catid'] = $catid;
$post['source_published_date'] = $dt->pubDate;
$post['source_url'] = $dt->link;
$post['source_url_txt'] = $srcTxt;
//images
$post['source_images'] = $this->saveImage($dt->image, 'instagram', $title, $title);
$post['source_content'] = $tcontent;$tableContent->store('instagram', $post, $oldId);
//
$numResult++;
}
}
//return $aResult;
$this->updateCacheInfo(0);
return ;
}
or you can change ordering $this->item from blog/portfolio layout in templates/ja_sugite/html/com_content/category/portfolio_item.php file
matgray87 Friendmatgray87
- Join date:
- November 2011
- Posts:
- 159
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 33
- Thanked:
- 8 times in 1 posts
September 29, 2014 at 5:03 pm #551026The method that the social feed is using to create the ID/createdate is fine… I just can’t change the ordering of the actual articles when displayed as Portfolio layout.
I’ve looked in the templates/ja_sugite/html/com_content/category/portfolio_item.php file, but can’t find anything to do with ordering…Where do I find that?
Cheers
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
September 30, 2014 at 2:58 am #551054@matgray87: You can change ordering array object in templates/ja_sugite/html/com_content/category/portfolio.php file with $this->lead_items and $this->intro_items
matgray87 Friendmatgray87
- Join date:
- November 2011
- Posts:
- 159
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 33
- Thanked:
- 8 times in 1 posts
September 30, 2014 at 1:12 pm #551174Hi,
Forgive me if i’m being naive, but what do I need to change it to to get it to order the articles by ID… I can’t see anything to do with the ordering here:
<?php if (empty($this->lead_items) && empty($this->link_items) && empty($this->intro_items)) :
if ($this->params->get('show_no_articles', 1)) : ?>
<p><?php echo JText::_('COM_CONTENT_NO_ARTICLES'); ?></p>
<?php endif; ?>
<?php endif; ?><?php $leadingcount = 0; ?>
<?php if (!empty($this->lead_items)) : ?>
<?php foreach ($this->lead_items as &$item) : ?>
<?php
$this->item = &$item;
echo $this->loadTemplate('item');
?>
<?php $leadingcount++; ?>
<?php endforeach; ?>
<?php endif; ?><?php
$introcount = (count($this->intro_items));
$counter = 0;
?><?php if (!empty($this->intro_items)) : ?>
<?php foreach ($this->intro_items as $key => &$item) : ?>
<?php $rowcount = ((int) $counter % (int) $this->columns) + 1; ?>
<?php
$this->item = &$item;
echo $this->loadTemplate('item');
?>
<?php $counter++; ?><?php endforeach; ?>
<?php endif; ?>
What do I need to add? Don’t I need to change something in the relevant menu?
ThanksNinja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
October 1, 2014 at 7:19 am #551308Here is code to help you order by article ID in portfolio.php file
-
1 user says Thank You to Ninja Lead for this useful post
matgray87 Friendmatgray87
- Join date:
- November 2011
- Posts:
- 159
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 33
- Thanked:
- 8 times in 1 posts
October 3, 2014 at 12:43 pm #551721Thanks, had to change it to arsort so that it went in the opposite order instead… but all good, and now sorted… thanks!
AuthorPostsViewing 7 posts - 1 through 7 (of 7 total)This topic contains 7 replies, has 2 voices, and was last updated by matgray87 10 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Portfolio Gallery Display by ID
Viewing 7 posts - 1 through 7 (of 7 total)