Thread Rating:
  • 21 Vote(s) - 3.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Release] ProPortal 1.0: A More Functional Portal!
Is it possable to add a refresh button to latest threads and posts are even use auto refresh using ajax?
(2011-02-24, 05:13 PM)Rapodo Wrote: Is it possable to add a refresh button to latest threads and posts are even use auto refresh using ajax?

You've already asked this for my project, ProPortal Redux. ProPortal is no longer supported nor developed.
[Image: 422.png]
thanks this share its very usefull too much
(2011-02-19, 06:43 PM)Steven Wrote:
(2011-02-19, 03:29 PM)ukanimal Wrote: 1) How can you stop 'Latest Threads' displaying certain forums on the portal - ie stop showing up deleted threads, staff posts etc

I never noticed that! It looks like the code for the default portal is much simpler than what ProPortal is doing. You can port it over:

// Latest forum discussions
if($mybb->settings['portal_showdiscussions'] != 0 && $mybb->settings['portal_showdiscussionsnum'])
{
	$altbg = alt_trow();
	$threadlist = '';
	$query = $db->query("
		SELECT t.*, u.username
		FROM ".TABLE_PREFIX."threads t
		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
		WHERE 1=1 $unviewwhere AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
		ORDER BY t.lastpost DESC 
		LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum']
	);
	while($thread = $db->fetch_array($query))
	{
		$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
		$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
		// Don't link to guest's profiles (they have no profile).
		if($thread['lastposteruid'] == 0)
		{
			$lastposterlink = $thread['lastposter'];
		}
		else
		{
			$lastposterlink = build_profile_link($thread['lastposter'], $thread['lastposteruid']);
		}
		if(my_strlen($thread['subject']) > 25)
		{
			$thread['subject'] = my_substr($thread['subject'], 0, 25) . "...";
		}
		$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
		$thread['threadlink'] = get_thread_link($thread['tid']);
		$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");
		eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";");
		$altbg = alt_trow();
	}
	if($threadlist)
	{ 
		// Show the table only if there are threads
		eval("\$latestthreads = \"".$templates->get("portal_latestthreads")."\";");
	}
}

(2011-02-19, 03:29 PM)ukanimal Wrote: 2) When you do 'Page Management' how do you get these pages on the portal?

I developed a simple block file that will list all the ProPortal pages.

(2011-02-19, 03:29 PM)ukanimal Wrote: 3) When you create a 'new block' how do you define a new one? it either comes out as just text, or if you pick a set one it clears it all out and add online users etc for example

I'm not sure what you mean. To create a new ProPortal block you simply make a new PHP file in /portal/blocks/ that follows the naming scheme ("block_[blockname].php") or you can create a text only block which is done through the ProPortal panel.
thanks, will have a play


Thank you Smile
can you please help a thicko - I cannot remember how / what to put in the .htaccess to it always loads the portal

thanks
(2011-02-25, 07:29 AM)ukanimal Wrote: can you please help a thicko - I cannot remember how / what to put in the .htaccess to it always loads the portal

DirectoryIndex portal.php
[Image: 422.png]
ta Smile
http://insectz.de/forum/thread-6832-lastpost.html
Hello

I'm having this issue with Latest posts block:

[Image: 747por.png]

I' using a lang file translated to spanish, and everything works just fine, except the title on the 'Latest Posts' block as you can see. I don't know why, but the changes made in the lang file are not recognized in that block.

Could someone tell me how to make the change please?
(2011-03-02, 04:00 AM)Torrecus Wrote: I' using a lang file translated to spanish, and everything works just fine, except the title on the 'Latest Posts' block as you can see. I don't know why, but the changes made in the lang file are not recognized in that block.

Could someone tell me how to make the change please?

Nice catch! For some reason that string is hard coded into the block file.

/portal/blocks/block_latestposts.php should be:

<?php
if (!defined("IN_PORTAL")) {
	die("<div style=\"border:1px solid #CC0000; padding:3px; margin:0; font-family:Tahoma; width:250px; font-size:12px;\"><strong>Error:</strong> This file cannot be viewed directly!</div>");
}

// Get forums user cannot view
$unviewable = get_unviewable_forums();
if($unviewable)
{
	$unviewwhere = " AND fid NOT IN ($unviewable)";
}

$altbg = alt_trow();
$threadlist = '';
$showlimit = 5;
$query = $db->query("
	SELECT p.*, u.username
	FROM ".TABLE_PREFIX."posts p
	LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
	WHERE p.visible='1' $unviewwhere
	ORDER BY p.dateline DESC 
	LIMIT 0, ".$showlimit
);
while($thread = $db->fetch_array($query))
{
	$lastpostdate = my_date($mybb->settings['dateformat'], $thread['dateline']);
	$lastposttime = my_date($mybb->settings['timeformat'], $thread['dateline']);
	// Don't link to guest's profiles (they have no profile).
	if($thread['uid'] == 0)
	{
		$lastposterlink = $thread['username'];
	}
	else
	{
		$lastposterlink = build_profile_link($thread['username'], $thread['uid']);
	}
	if(my_strlen($thread['subject']) > 20)
	{
		$thread['subject'] = my_substr($thread['subject'], 0, 20) . "...";
	}
	$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
	$thread['threadlink'] = get_post_link($thread['pid'],$thread['tid']);
	$threadlist .= "<tr>
<td class=\"$altbg\">
<strong><a href=\"".$mybb->settings['bburl']."/".$thread['threadlink']."#pid".$thread['pid']."\">$thread[subject]</a></strong>
<span class=\"smalltext\"><br />
$lang->posted_by <em>$lastposterlink</em><br />
$lastpostdate $lastposttime
</span>
</td>
</tr>";
	$altbg = alt_trow();
}
if($threadlist)
{ 
	// Show the table only if there are threads
	$latestposts = "<table border=\"0\" cellspacing=\"".$theme['borderwidth']."\" cellpadding=\"".$theme['tablespace']."\" class=\"tborder\">
		<tr>
			<td class=\"thead\"><div class=\"expcolimage\"><img src=\"{$theme['imgdir']}/{$expcolimage}\" id=\"block_{$result_blocks['id']}_img\" class=\"expander\" alt=\"{$expaltext}\" title=\"{$expaltext}\" /></div><strong>{$lang->latest_posts}</strong></td>
		</tr>
		<tbody style=\"{$expdisplay}\" id=\"block_{$result_blocks['id']}_e\">
		{$threadlist}
		</tbody>
	</table>";
}
else
{
	$latestposts = "<table border=\"0\" cellspacing=\"".$theme['borderwidth']."\" cellpadding=\"".$theme['tablespace']."\" class=\"tborder\">
		<tr>
			<td class=\"thead\"><div class=\"expcolimage\"><img src=\"{$theme['imgdir']}/{$expcolimage}\" id=\"block_{$result_blocks['id']}_img\" class=\"expander\" alt=\"{$expaltext}\" title=\"{$expaltext}\" /></div><strong>{$lang->latest_posts}</strong></td>
		</tr>
		<tbody style=\"{$expdisplay}\" id=\"block_{$result_blocks['id']}_e\">
		<tr>
		<td class=\"$altbg\">No Post</td>
		</tr>
		</tbody>
	</table>";
}

echo $latestposts;
?>
[Image: 422.png]
how comes you get a different portal view in firefox than you do in ie?


Forum Jump:


Users browsing this thread: 1 Guest(s)