Jump to content


[CLOSED] Uportal + IPB BLog


  • This topic is locked This topic is locked
7 replies to this topic

#1 Frank N Stein

    Advanced Member

  • Members
  • PipPipPip
  • 48 posts
  • Gender:Male

Posted 28 December 2009 - 12:40 PM

Hi, can somebody tell me how i cant do to show the lastest post of IPBLOG on the uportal?

I using ipb305 + ipblog204 + up301

thanks a lot

#2 Frank N Stein

    Advanced Member

  • Members
  • PipPipPip
  • 48 posts
  • Gender:Male

Posted 31 December 2009 - 11:48 AM

Help please...!!

#3 Steve

    Advanced Member

  • Administrators[Admin]
  • PipPipPip
  • 130 posts
  • Gender:Male

Posted 31 December 2009 - 12:11 PM

Sorry, I don't have the blog on my system. Is there a side bar hook that shows the latest post of the blog on the side bar? If so, pm me blog hook file that is created in the hooks folder.

#4 Frank N Stein

    Advanced Member

  • Members
  • PipPipPip
  • 48 posts
  • Gender:Male

Posted 05 January 2010 - 04:03 PM

Hi Steve, thanks a lot for the time to response to me.

I cant found something that do a preview of the lastest post, but in this days i can create a little query (below) that retrieve the information about the entries. may be i need make a left(entry,500) because the entries can be too long but is the idea.

Quote

select entry_id, entry_last_update, entry_name, blog_id, entry
from papercraft.for_blog_entries
where entry_status='published'
order by entry_date DESC
limit 0, 20


whit the query i have the preview, and adding a link like this to "read more" it will works

Quote



Can you help me to do this idea a real block or somethig similar?

Thanks a lot again, and excuse my english.
Diego

#5 Frank N Stein

    Advanced Member

  • Members
  • PipPipPip
  • 48 posts
  • Gender:Male

Posted 14 January 2010 - 09:34 AM

Well Steve and all... today is the day...

Finally i make a little block to display the last three entries of the blogs on my UP.
But i still fighting whit the ouput text, it have content like:

Quote

[ img ]htt p://img706.ima geshack.us/img706/67/img35067297126591.jpg[/ img ] and [font="Microsoft Sans Serif"]
and i want to erase all between "[" and "]" inclusive.

can you help me to do this little tip to finish?

Thanks a lot again, and this is mi custom block for all that want it:

Quote

<table class='ipb_table' cellspacing="1">
<tbody>
<tr>
<td class='row2'>

<?php
$extra = " ";

if( $this->blog['hidden_cats'] )
{
$extra .= " AND category_id NOT IN(" . $this->blog['hidden_cats'] . ")";
}

$this->DB->build( array(
'select' => 'entry_id, entry_last_update, entry_name, blog_id, entry',
'from' => 'blog_entries',
'where' => "entry_status='published'" . $extra,
'order' => 'entry_date DESC',
'limit' => array( 0, 3 )
) );
$this->DB->execute();

while( $entry = $this->DB->fetch() )
{
$entries[] = $entry;
}

if( is_array( $entries ) )
{
$return_html .= '<table>';
$return_html .= '<tr>';

foreach( $entries as $entry )
{

$return_html .= '<td valign="top" width="33%">';
$return_html .= '<b><a href="index.php?app=blog&module=display&section=blog&showentry=' . $entry['entry_id'] . '">' . $entry['entry_name'] . '</a></b> del ' . gmdate("Y-m-d", $entry['entry_last_update']) . '<br>';
$return_html .= substr($entry['entry'], 0, 200);
$return_html .= '<br><br><a href="index.php?app=blog&module=display&section=blog&showentry=' . $entry['entry_id'] . '"> Seguir leyendo... </a>';
$return_html .= '</td>';

}

$return_html .= '</tr>';
$return_html .= '</table>';

}

echo $return_html;


?>

</td>
</tr>
</tbody>
</table>


#6 Frank N Stein

    Advanced Member

  • Members
  • PipPipPip
  • 48 posts
  • Gender:Male

Posted 18 January 2010 - 12:42 PM

Well, finally i found the hook of the board that show the last entries, with some modifications i made this custom block code that works perfectly!

Thank a lot again, the code:

<table class='ipb_table' cellspacing="1">
    <tbody>
        <tr>
            <td class='row2'>

<?php


		/* Unserialize blog permissions */
		if( ! $this->memberData['g_blog_settings'] )
		{
			return '';
		}
		
		if( ! is_array( $this->memberData['g_blog_settings'] ) )
		{
			$this->memberData['g_blog_settings'] = unserialize( $this->memberData['g_blog_settings'] );
		}
		
		/* Check permission */
		if( $this->memberData['g_blog_settings']['g_blog_allowview'] )
		{
			/* Query bits */
			$extra			= '';
			$allowguests	= '';
			
			if( ! $this->memberData['member_id'] )
			{
				$allowguests .= " AND b.blog_allowguests = 1";
			}
			
			if( ! $this->memberData['_blogmod']['moderate_can_view_private'] )
			{
				$extra = " AND ( ( ( p.owner_only=1 AND b.member_id={$this->memberData['member_id']} ) OR p.owner_only=0 ) AND ( p.authorized_users LIKE '%,{$this->memberData['member_id']},%' OR p.authorized_users IS NULL ) ) ";
			}

			/* Query the entires */
			$this->DB->build( array( 
										'select'	=> "e.*",
										'from'		=> array('blog_entries' => 'e'),
										'add_join'	=> array( 
															array( 
																	'select'	=> 'b.blog_name',
																	'from'		=> array( 'blog_blogs' => 'b' ),
																	'where'		=> "e.blog_id=b.blog_id",
																	'type'		=> 'left'
																),
															array(
																	'from'		=> array( 'permission_index' => 'p' ),
																	'where'		=> "p.perm_type_id=b.blog_id AND p.perm_type='blog'",
																	'type'		=> 'left'
																),
															array(
																	'select'	=> 'm.members_display_name, m.members_seo_name',
																	'from'		=> array( 'members' => 'm' ),
																	'where'		=> 'e.entry_author_id=m.member_id',
																	'type'		=> 'left'
																)
														),
										'where'		=> "b.blog_type='local' AND e.entry_status='published'".$allowguests.$extra,
										'order'		=> 'e.entry_date DESC',
										'limit'		=> array( 0, 5 )
							  )	);
			$this->DB->execute();

			/* Loop through and build the blog entries array */
			$entries_array = array();

			while( $entry = $this->DB->fetch() )
			{
				$entry['_seo_entry_name'] = IPSText::makeSeoTitle( $entry['entry_name'] );
				$entries_array[] = $entry;
			}
			
			echo $this->registry->output->getTemplate( 'boards' )->hookRecentBlogEntries( $entries_array );
		}
		else
		{
			echo '';
		}

?>

            </td>
        </tr>
    </tbody>
</table>


#7 Steve

    Advanced Member

  • Administrators[Admin]
  • PipPipPip
  • 130 posts
  • Gender:Male

Posted 18 January 2010 - 12:49 PM

That's what i would of done also.

#8 Frank N Stein

    Advanced Member

  • Members
  • PipPipPip
  • 48 posts
  • Gender:Male

Posted 20 January 2010 - 12:22 PM

Ya... your previous post let me thinking... and when i enter to invision power site and see what i want... the rest is only "copy/paste"

Thanks a lot again...





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users