User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

Community



Donate

Donate for PortaMx !
Your donation is safe and helps support the issues and causes you care most about.

Stats

  • *Total Members: 4010
  • *Latest: kuki78

  • *Total Posts: 15656
  • *Total Topics: 2322
  • *Online Today: 23
  • *Most Online: 157
(27 Aug 09, 03:54:53)
  • *Users: 0
  • *Guests: 19
  • *Total: 19

Author Topic: Blog feed block  (Read 10354 times)

0 Members and 1 Guest are viewing this topic.

Offline bluedevil

  • Newbie
  • *
  • Posts: 21
  • Gender: Male
    • ChevyAvalancheClub
Re: Blog feed block
« Reply #30 on: 17 Feb 10, 22:40:18 »
Based on the code i posted above, showing blog posts from admin or global moderator only cant be done?

I dont want to show regular users blog posts in a block.

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5224
  • Gender: Female
Re: Blog feed block
« Reply #31 on: 17 Feb 10, 22:55:17 »
set the access rights for the block ...

Fel
Many are stubborn in relation to the path, a few in relation to the target.

Offline bluedevil

  • Newbie
  • *
  • Posts: 21
  • Gender: Male
    • ChevyAvalancheClub
Re: Blog feed block
« Reply #32 on: 17 Feb 10, 23:08:15 »
set the access rights for the block ...

Fel



I want everyone to see my (admin) blog posts in the front page in a block.  I dont want to publish regular users.

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5224
  • Gender: Female
Re: Blog feed block
« Reply #33 on: 18 Feb 10, 10:32:09 »
I understand correctly, that YOUR blog should be see for all, but not the articles in the other blog users?
In this case I must say, that this is not possible ...

Fel
Many are stubborn in relation to the path, a few in relation to the target.

Offline Tormod

  • Newbie
  • *
  • Posts: 22
  • Gender: Male
    • Fuglepraten.no
Re: Blog feed block
« Reply #34 on: 19 Apr 10, 15:04:13 »
Yes, try this ..
Code: [Select]
include_once('PmxBlogSSI.php');
global $context, $smcFunc, $user_info, $txt;

$maxarticles = 5; // max articles to show
$context['PmxBlog']['content_len'] = 40; // Teaser length

if(AllowedToBlog('view'))
{
$result = array();
$req = $smcFunc['db_query']('', '
SELECT c.ID, c.subject
FROM {db_prefix}pmxblog_content AS c
LEFT JOIN {db_prefix}members AS m ON (c.owner = m.id_member)
LEFT JOIN {db_prefix}pmxblog_manager AS a ON (c.owner = a.owner)
WHERE a.blogenabled > 0 AND a.bloglocked = 0 AND c.published = 1
AND (c.allow_view = 0
OR (c.allow_view = 1 AND {int:idmem} > 0)
OR (c.allow_view = 2 AND {string:s_idmem} IN (m.buddy_list))
OR (c.allow_view = 3 AND c.owner = {int:idmem})
OR (c.owner = {int:idmem}))
GROUP BY c.ID
ORDER BY c.date_created DESC
LIMIT {int:lim}',
array(
's_idmem' => (string) $user_info['id'],
'idmem' => $user_info['id'],
'lim' => $maxarticles,
)
);
if($smcFunc['db_num_rows']($req) > 0)
{
$i = 0;
while($row = $smcFunc['db_fetch_assoc']($req))
{
$result[$i] = array('id' => $row['ID'], 'subject' => $row['subject']);
$i++;
}
$smcFunc['db_free_result']($req);
}

// link requested?
if(isset($_REQUEST['blogcont']))
$artid = (int) $_REQUEST['blogcont'];
elseif(!empty($result))
$artid = $result[0]['id'];
else
{
echo '
'. $txt['PmxBlog_nothing_read'];
return;
}

// get the selected article data
$article = PmxBlogSSI_GetArticle($artid, '');
$article['body'] = Post_Teaser($article['body']); // call the teaser
PmxBlogArticles_SSI_Out($article, $result, $artid);
}

Fel

I want to have a link say Read more, where Do I put that, and what to write the code? This feed work good for my website.

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5224
  • Gender: Female
Re: Blog feed block
« Reply #35 on: 19 Apr 10, 16:51:57 »
Try this code in a php block...
Code: [Select]
include_once('PmxBlogSSI.php');
global $context, $smcFunc, $user_info, $txt, $scripturl;

$maxarticles = 5;   // max articles to show
$context['PmxBlog']['content_len'] = 40;      // Teaser length

if(AllowedToBlog('view'))
{
   $result = array();
   $req = $smcFunc['db_query']('', '
      SELECT c.ID, c.subject
      FROM {db_prefix}pmxblog_content AS c
      LEFT JOIN {db_prefix}members AS m ON (c.owner = m.id_member)
      LEFT JOIN {db_prefix}pmxblog_manager AS a ON (c.owner = a.owner)
      WHERE a.blogenabled > 0 AND a.bloglocked = 0 AND c.published = 1
         AND (c.allow_view = 0
         OR (c.allow_view = 1 AND {int:idmem} > 0)
         OR (c.allow_view = 2 AND {string:s_idmem} IN (m.buddy_list))
         OR (c.allow_view = 3 AND c.owner = {int:idmem})
         OR (c.owner = {int:idmem}))
      GROUP BY c.ID
      ORDER BY c.date_created DESC
      LIMIT {int:lim}',
      array(
         's_idmem' => (string) $user_info['id'],
         'idmem' => $user_info['id'],
         'lim' => $maxarticles,
      )
   );
   if($smcFunc['db_num_rows']($req) > 0)
   {
      $i = 0;
      while($row = $smcFunc['db_fetch_assoc']($req))
      {
         $result[$i] = array('id' => $row['ID'], 'subject' => $row['subject']);
         $i++;
      }
      $smcFunc['db_free_result']($req);
   }

   // link requested?
   if(isset($_REQUEST['blogcont']))
      $artid = (int) $_REQUEST['blogcont'];
   elseif(!empty($result))
      $artid = $result[0]['id'];
   else
   {
      echo '
      '. $txt['PmxBlog_nothing_read'];
      return;
   }

   // get the selected article data
   $article = PmxBlogSSI_GetArticle($artid, '');
   $article['body'] = Post_Teaser($article['body']);   // call the teaser

   // add a "Read more" link...
   $article['body'] .= '<div style="padding-top:10px;"><a href="'. $scripturl .'?action=pmxblog;sa=view;cont='. $artid .';uid='. $article['ownerid'] .'">'. $txt['PmxBlog_readmore'] .'</a></div>';

   PmxBlogArticles_SSI_Out($article, $result, $artid);
}

Fel
Many are stubborn in relation to the path, a few in relation to the target.

Offline justdownload.us

  • Laughter is the Best Medicine...
  • Newbie
  • *
  • Posts: 28
  • Gender: Male
  • Smiling makes me Smile
    • Click and Share Files!!
Re: Blog feed block
« Reply #36 on: 15 Sep 10, 14:57:05 »
how we put also the avatar for the blogger's it can be done to that?  O0
DOn't BeLiEve tHat yOu kNow EverYthiNg!!

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5224
  • Gender: Female
Re: Blog feed block
« Reply #37 on: 15 Sep 10, 15:30:26 »
That is not possible with the PmxBlogSSI functions without a complexe rewrite.

Fel
Many are stubborn in relation to the path, a few in relation to the target.

Offline justdownload.us

  • Laughter is the Best Medicine...
  • Newbie
  • *
  • Posts: 28
  • Gender: Male
  • Smiling makes me Smile
    • Click and Share Files!!
Re: Blog feed block
« Reply #38 on: 19 Sep 10, 14:14:05 »
Great!!  Thanks Fel...that works better,
Code: [Select]
include_once('PmxBlogSSI.php');
PmxBlogSSI_ShowArticles(2);
but displays too much for a side block.(see attached pmx_blog_sideblock2.jpg)  I was hoping that by using cools' example as a starting point (because it only displays title, author, date/time as in attached pmx_blog_sideblock1.jpg) that it would work similarly to the way his original code does (less info, trunicated or no content, without calendar or categories) ,  sorry I did look into the samples again, but Im just not sure what code to use in order to make it work.

sorry for the question

can my blog block will be in right or left block? i f yes what will be the code coz im just starting php lesson or just give hints or tips...

thanks again..

More power to your site..
DOn't BeLiEve tHat yOu kNow EverYthiNg!!

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5224
  • Gender: Female
Re: Blog feed block
« Reply #39 on: 19 Sep 10, 18:14:05 »
Blog articles in a side block is a little bit to heavy I think ;)

Fel
Many are stubborn in relation to the path, a few in relation to the target.

Offline trench

  • Newbie
  • *
  • Posts: 36
    • NO WALLS STANDING
Re: Blog feed block
« Reply #40 on: 03 Jul 11, 11:00:47 »
with the RSS Reader block you can read feeds from any page the have a rss feed.

Fel

Is there a RSS feed for the Blog you guys have coded for PortaMX?

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5224
  • Gender: Female
Re: Blog feed block
« Reply #41 on: 03 Jul 11, 14:40:00 »
No ...
Many are stubborn in relation to the path, a few in relation to the target.

Offline Draffi

  • Newbie
  • *
  • Posts: 10
Re: Blog feed block
« Reply #42 on: 27 Aug 11, 23:15:30 »
Sorry for to bump this old topic...

Is there a way to show this block for the last 5 Blog-entries from all the blog-user (the latest blog entries from all blogs)?

Hope u understand, what i mean.

Thanks in advance...

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5224
  • Gender: Female
Re: Blog feed block
« Reply #43 on: 28 Aug 11, 16:05:21 »
I'm not sure ..
You can use the Recent Function from the PmxBlog_SSI.php or you have to write your own query.
Look at the PmxBlog_SSI exmaples ...
Many are stubborn in relation to the path, a few in relation to the target.