News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

SimplePortal

Started by SimplePortal Team, March 10, 2008, 11:16:07 PM

Previous topic - Next topic

[SiNaN]

avf:

Use this code in a PHP block:

global $context, $settings, $scripturl, $txt, $db_prefix, $ID_MEMBER;
global $user_info, $modSettings, $func;

if($context['user']['is_guest'])
return;

if (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude_boards = array($modSettings['recycle_board']);
else
$exclude_boards = array();

$request = db_query("
SELECT
m.posterTime, m.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG, m.ID_BOARD, b.name AS bName,
IFNULL(mem.realName, m.posterName) AS posterName, LEFT(m.body, 384) AS body, m.smileysEnabled
FROM ({$db_prefix}messages AS m, {$db_prefix}boards AS b)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
WHERE m.ID_MSG >= " . ($modSettings['maxMsgID'] - 25 * min(10, 5)) . "
AND b.ID_BOARD = m.ID_BOARD" . (empty($exclude_boards) ? '' : "
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . "
AND $user_info[query_see_board]
AND m.ID_MEMBER = $ID_MEMBER
ORDER BY m.ID_MSG DESC
LIMIT 10", __FILE__, __LINE__);
$posts = array();
while ($row = mysql_fetch_assoc($request))
{
$row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']), array('<br />' => '')));
if ($func['strlen']($row['body']) > 128)
$row['body'] = $func['substr']($row['body'], 0, 128) . '...';

censorText($row['subject']);
censorText($row['body']);

$posts[] = array(
'board' => array(
'id' => $row['ID_BOARD'],
'name' => $row['bName'],
'href' => $scripturl . '?board=' . $row['ID_BOARD'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . '.0">' . $row['bName'] . '</a>'
),
'topic' => $row['ID_TOPIC'],
'poster' => array(
'id' => $row['ID_MEMBER'],
'name' => $row['posterName'],
'href' => empty($row['ID_MEMBER']) ? '' : $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => empty($row['ID_MEMBER']) ? $row['posterName'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>'
),
'subject' => $row['subject'],
'short_subject' => shorten_subject($row['subject'], 25),
'preview' => $row['body'],
'time' => timeformat($row['posterTime']),
'timestamp' => forum_time(true, $row['posterTime']),
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . '#msg' . $row['ID_MSG'] . '">' . $row['subject'] . '</a>',
);
}
mysql_free_result($request);

if(empty($posts))
return;

echo '
<table border="0" class="ssi_table">';
foreach ($posts as $post)
echo '
<tr>
<td align="left" valign="top" nowrap="nowrap">
<a href="', $post['href'], '">', $post['subject'], '</a><br />
[', $post['board']['link'], ']<br />
', $post['time'], '
<hr />
</td>
</tr>';
echo '
</table>';


asudhakar:

../SSI.php

Find:

AND t.ID_POLL = p.ID_POLL
AND b.ID_BOARD = t.ID_BOARD


Replace:

AND t.ID_POLL = p.ID_POLL
AND b.ID_BOARD = t.ID_BOARD
AND b.ID_BOARD = 68


Tollboy:

index.template.php

Find:

// Show the [help] button.

Replace:

// Show the [forum] button.
echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
<td valign="top" class="maintab_' , $current_action == 'forum' ? 'active_back' : 'off_back' , '">
<a href="', $scripturl, '?action=forum">' , $txt['wow_forum_button_forum'] , '</a>
</td>' , $current_action == 'forum' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';

// Show the [help] button.


Find:

'login', 'help', 'pm'

Replace:

'login', 'help', 'pm', 'forum', 'spadmin'

Find:

$current_action = 'search';

Replace:

$current_action = 'search';
if (isset($_GET['board']) || isset($_GET['topic']))
$current_action = 'forum';
if ($context['current_action']=='spadmin')
$current_action = 'admin';


For the panel problem, add these codes before the ?> code in your

../Themes/wowdk_115v1/languages/Modifications.english.php

// SP General
$txt['sp-forum'] = 'Forum';
$txt['sp-adminTitle'] = 'SPortal Admin';
$txt['sp-adminCatTitle'] = 'SimplePortal';
$txt['sp-articlesCategory'] = 'Article Category';
$txt['sp-articlesNoCategory'] = 'Do not Publish';
$txt['sp-make_article'] = 'Make Article';
$txt['error_sp_no_message_id'] = 'Invalid message ID.';
$txt['error_sp_article_exists'] = 'Article already exists.';
$txt['error_sp_cannot_add_article'] = 'You don\'t have permission to add article.';
$txt['error_sp_label_empty'] = 'Label is left empty.';
$txt['error_sp_name_empty'] = 'Name is left empty.';
$txt['error_sp_no_category'] = 'There is no article category created.';

// SP Permissions
$txt['permissiongroup_sp'] = 'SimplePortal';
$txt['permissionname_sp_moderate'] = 'Moderate portal';
$txt['permissionhelp_sp_moderate'] = 'This permission allows users to access the SimplePortal Admin panel.';
$txt['permissionname_sp_add_article'] = 'Can add article';
$txt['permissionhelp_sp_add_article'] = 'This permission allows users to add articles.';
$txt['permissionname_sp_auto_article_approval'] = 'Auto article approval';
$txt['permissionhelp_sp_auto_article_approval'] = 'This permission allows users to add articles without approval.';

// SP Blocks
$txt['sp-userpost'] = 'Posts';
$txt['sp-userkarma'] = 'Karma';
$txt['sp-usertmessage'] = 'Total Messages';
$txt['sp-usernmessage'] = 'New Messages';
$txt['sp-userprofile'] = 'Profile';
$txt['sp-userlogout'] = 'Logout';
$txt['sp-onlineguest'] = 'Online Guests';
$txt['sp-onlineuser'] = 'Online Users';
$txt['sp-onlinehuser'] = 'Hidden Users';
$txt['sp-onlinetuser'] = 'Total Users';
$txt['sp-onlineouser'] = 'Online Users';
$txt['sp-statmember'] = 'Total Members';
$txt['sp-statpost'] = 'Total Posts';
$txt['sp-stattopic'] = 'Total Topics';
$txt['sp-statcategory'] = 'Total Categories';
$txt['sp-statboard'] = 'Total Boards';
$txt['sp-qsearchsearch'] = 'Search';
$txt['sp-tposterpost'] = ' posts';
$txt['sp-tboardname'] = 'Board';
$txt['sp-tboardpost'] = 'Posts';
$txt['sp-ttopicname'] = 'Topic';
$txt['sp-ttopicpost'] = 'Posts';
$txt['sp-grpictureviews'] = 'Views:';
$txt['sp-grpicturesender'] = 'By:';
$txt['sp-grpictureguest'] = 'Guest';
$txt['sp-arcadeplay'] = 'The Top Players';
$txt['sp-arcadewin'] = 'Number Of Wins :';
$txt['sp-arcadelate'] = 'Latest High Score by ';
$txt['sp-arcadewit'] = 'with ';
$txt['sp-arcadeon'] = 'on ';



mymktp1:

That problem should have been solved. Maybe there is a problem with the database query in the package.

Did you made a fresh install or updated from the earlier versions?

Also can you try this code from your PhpMyAdmin?

ALTER TABLE smf_sp_articles CHANGE ID_ARTICLE ID_ARTICLE INT( 10 ) UNSIGNED DEFAULT 0 NOT NULL
Former SMF Core Developer | My Mods | SimplePortal

mymktp1

THANK YOU THatCode worked for me thanx again!

[SiNaN]

Okay, glad that it worked but we must solve this problem in the package too.

Did you update from earlier versions or its a fresh install?
Former SMF Core Developer | My Mods | SimplePortal

avf

Sinan all i can say is Thank you ! for a great mod and awesome support !
avf

Sudhakar Arjunan

Quote from: [SiNaN] on August 06, 2008, 08:21:54 AM

asudhakar:

../SSI.php

Find:

AND t.ID_POLL = p.ID_POLL
AND b.ID_BOARD = t.ID_BOARD


Replace:

AND t.ID_POLL = p.ID_POLL
AND b.ID_BOARD = t.ID_BOARD
AND b.ID_BOARD = 68



Hi I have tried adding the 3rd line with the correct board number of board polling station.
No change in the portal page.
Went through blocks list and removed the existing poll number and check, it changed the value a 0 and not shows any polls.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

mymktp1

HI Sinan... I guess it worked for that one post...I'm now getting this Error everytime I try t make a topic an article

Duplicate entry '0' for key 1
File: /hsphere/local/home/kitping/timsradio.net/smf/Sources/Subs-SPortal.php
Line: 181

I originally Installd Version 2.0 and uninstalled it from the Packages Manager (But didn't delete the install package for that version)  and then Installed Version 2.02...


tuguex

Thanks SiNaN =)

I attach here my index.php file, the "sources" folder, and my "Apollo BB" (theme)  folder .
Should i upload too my default theme files?

thks ;)

mymktp1



hey Sinan I fixed my problem for some reason it gave me that error because the Auto-Incremnet Dissapeared all is working well now... this is how my database looks like...

jmil

I installed Simple POrtal on my site (1.1.5, Black 45 Theme). Using the Instructions in this thread, I do not see all the changes to make it work properly. The install went fine (no errors) - but when I enable it - my current Board goes blank, turning it off and all returns fine.

Any assitance and/or instructions would be appreciated. I have attached my display.template.php and index.template.php from my theme.

The Chief

dgandy

Quote from: dgandy on August 02, 2008, 07:08:00 AM
Hi SiNaN.  :)

This mod is fantastic. Thank you for your hard work.

I have the Thumbnail on Topic mod by vbgamer45. When I set up a board news block, I would like the thumbnail image of the topic I selected to show. I think I need to incorporate this line somewhere.. $topic['first_post']['icon_url'],. I am an idiot when it comes to php and have no idea where to do this.

Can you help?

Hi SiNaN
I've been trying to figure out how to get images included in posts to show on the home page. The articles block works good but, doesn't show pictures. I realized it doesn't have to be the images from the mod I mentioned before.

I set up some html blocks to show what I am trying to do with an article block. If you have time to look at it... http://simsfashionbarn.net/SMF/index.php (it's the block labeled Recent Additions). It takes a lot of time setting up the html blocks.

I know you are busy, bless your heart. If you do have any idea that isn't too complicated for me to do (a php idiot) please let me know. All I want to be able to do is to include a thumbnail of the image in the article I select when I build an article block.

Thanks


kriskd

With 50 pages of posts, it's likely this has been asked, but the search topic feature only seems to return the original post.  ???

Anyway, is there anyway I can get some of the block to appear on my board index, say to the left of the list of boards?  I don't need the full portal, but a who's online block on the board index might be useful to me.  :)
SMF 2.0.2

Sudhakar Arjunan

Quote from: kriskd on August 09, 2008, 08:04:22 AM
With 50 pages of posts, it's likely this has been asked, but the search topic feature only seems to return the original post.  ???

Anyway, is there anyway I can get some of the block to appear on my board index, say to the left of the list of boards?  I don't need the full portal, but a who's online block on the board index might be useful to me.  :)

This is just a Simple portal. A portal page .
As if now it could not be on the board index.

But SiNaN is working on the feature also like one in Tiny Portal where you could have one particular block through the forum or board index.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Stef001

Is it working on SMF 2.0 Beta 3.1 Public

Thanks Stef.
SMF 2.0.2 | SimplePortal 2.3.5

jmil

 
Quote from: jmil on August 08, 2008, 03:00:44 PM
I installed Simple POrtal on my site (1.1.5, Black 45 Theme). Using the Instructions in this thread, I do not see all the changes to make it work properly. The install went fine (no errors) - but when I enable it - my current Board goes blank, turning it off and all returns fine.

Update Got most of it working now but When I turn on the profile block all the icons for post, karma, etc show the dreaded red (x)

Any assitance and/or instructions would be appreciated. I have attached my display.template.php and index.template.php from my theme.

The Chief

(V)eGa

First and foremost [SiNaN], this mod is awesome. ;)

There is only one thing that puzzles me.  When I first installed the mod and made my first post on the board, it worked perfectly.  After adding all the other post to my forum, when I go to make a article now, it's never the article that is should be.  Now matter which article I select, it always links back to the same post.  So I tried to delete that post and now when I make an article, it links to the post still but since it's deleted, it just makes a blank article with funky dates.  You can view my site at:

hxxp:www.ppcthemes.net [nonactive]

I run a Windows Mobile theme website and I only wanted to add news and a message about the comedian Bernie Mac dying :(

Thanks in advance

Manu.G

#995
Quote from: jmil on August 08, 2008, 03:00:44 PM
I installed Simple POrtal on my site (1.1.5, Black 45 Theme). Using the Instructions in this thread, I do not see all the changes to make it work properly. The install went fine (no errors) - but when I enable it - my current Board goes blank, turning it off and all returns fine.

Any assitance and/or instructions would be appreciated. I have attached my display.template.php and index.template.php from my theme.

The Chief

Hi,

I hope it was ok that I took a look at your files.
I have add the changes to your index.template.php and I think after you have loaded up the index.template.php everything in your forum will work fine. Changes in the Display.template.php weren't for need, cause the code which has to been add was there.

Don't forget to make a backup of your index.template.php before you load up the modified one. ;)

I saw the icons in the portal aren't to see, you have to load up dot.gif and arrow.gif. ;)
Version SMF 2.0.8
SimplePortal 2.3.5

jmil

#996
Great Feature this Portal - I have everything mostly working except the images (Icons) for things like posts, karma Online etx   I get the dreaded RED X for those images. Site is at www.forums.midatlanticxriders.com

Not sure what to attach to take a look at so I put my Sportal.php- Any help would be appreciated.


Manu.G

You have only to load up the images dot.gif and arrow.gif to your current theme image folder
Version SMF 2.0.8
SimplePortal 2.3.5

jmil

Sounds simple but where are those gifs?  ???

jmil


Advertisement: