collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 332
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Thanks for having an interest with our portal. If you have any requests for features, have a look at the Feature Requests board.

Author Topic: Recent bugs/features SMF Project (Issue Tracker)  (Read 16129 times)

0 Members and 1 Guest are viewing this topic.

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Recent bugs/features SMF Project (Issue Tracker)
« on: May 12, 2009, 06:27:12 PM »
SMF Projects recent bugs/features Block
[Made by Blue][I hope you like it =D]

Description: A fully customizable block that shows recent bugs/features posted in the Issue Tracker.

Requirements:
- SMF 2.0 GOLD
- SMF Projects 0.5.3
- Simple Portal 2.3.3

SETUP INSIDE:
+ You can choose how many bugs/features you want to output
+ Show replies or not
+ Show Project Category or not
+ Show who posted or not
+ Show status color or not
+ You can translate it to your own language with $txt inside

Author Notes:
Code Updated to Simple Portal 2.3.3 and SMF Projects 0.5.3

Screenshot:
(this pictures has every option ON - you can turn some OFF)


Code: [Select]
<?php
/*
Block: SMF Projects Recent bugs/features Block
Author: Blue @ Chrome

Requirements:
- SMF 2.0 RC1+
- SMF Projects
- Simple Portal 2.2.1+
*/

/* [SETUP WHAT YOU WANT HERE] */

// How many recent bugs/feature do you want to output?
$limit 5;

// Do you want to show Replies? YES = 1 | NO = 0
$show_replies 1;

// Do you want to show Project Category? YES = 1 | NO = 0
$show_category 1;

// Do you want to Show who Posted? YES = 1 | NO = 0
$show_posted 1;

// Do you want to Show color status? YES = 1 | NO = 0
$show_color 1;

// Do you want to translate it to your own language? :P
$txt['projects_false'] = 'SMF Projects not found';
$txt['sportal_false'] = 'Simple Portal not found';

$txt['project_cat'] = 'In';
$txt['who'] = 'by';
$txt['replies'] = 'Replies';
$txt['status'] = 'Status';

$txt['new'] = 'New';
$txt['feedback'] = 'Feedback';
$txt['confirmed'] = 'Confirmed';
$txt['assigned'] = 'Assigned';
$txt['resolved'] = 'Resolved';
$txt['closed'] = 'Closed';

/* [STOP!] - THIS IS THE END OF SETUP */

//Only code from now on ;)
global $smcFunc$scripturl$settings$sourcedir;

// Lets see if you are using SMF Projects and Simple Portal. If not...well...go get them :D
if (!file_exists($sourcedir '/Project.php'))
{
echo $txt['projects_false'];
return;
}
if (!
file_exists($sourcedir '/PortalBlocks.php'))
{
echo $txt['sportal_false'];
return;
}

// Permission check :P
isAllowedTo('project_access');

// Let's grab some database results
$dbresult $smcFunc['db_query'](''"
SELECT 
i.id_issue, i.subject, i.id_project, i.status, i.id_tracker, i.id_reporter, i.replies, m.real_name, m.id_member, p.name
FROM {db_prefix}issues AS i
LEFT JOIN {db_prefix}members AS m ON (i.id_reporter = m.id_member)
LEFT JOIN {db_prefix}projects AS p ON (i.id_project = p.id_project)
ORDER BY id_issue DESC
LIMIT 
$limit");
while ($blue $smcFunc['db_fetch_assoc']($dbresult))
{
echo
'
<ul class="sp_list">
<li class="sp_list_top">'
;
if ($blue['id_tracker'] == '1') {
echo'<img src="'$settings['images_url'], '/bug.png" alt="'$blue['id_tracker'], '" />'; }
else {
echo'<img src="'$settings['images_url'], '/feature.png" alt="'$blue['id_tracker'], '" />'; }
echo'<a href="'$scripturl'?issue='$blue['id_issue'], '"> '$blue['subject'], '</a>
</li>
<li class="sp_list_indent sp_list_bottom smalltext">'
;


// If, if, if, if, if, xD
if ($show_category == 1)
{
echo'
'
$txt['project_cat'], ' <a href="' $scripturl .'?project='$blue['id_project'], '">['$blue['name'], ']</a>';
}


if (
$show_posted == 1)
{
echo'
'
$txt['who'], ' <a href="' $scripturl .'?action=profile;u='$blue['id_member'], '">'$blue['real_name'], '</a>';
}

if (
$show_replies == 1)
{
echo
$txt['replies'], ': '$blue['replies'];
}


if (
$show_color == 1)
{
if($blue['status'] == 1) {
echo
' | '$txt['status'], ':<span style="background-color:#FFCCCC">&nbsp;'$txt['new'], '&nbsp;</span>';
} elseif ($blue['status'] == 2) {
echo
' | '$txt['status'], ':<span style="background-color:#FF50A8">&nbsp;'$txt['feedback'], '&nbsp;</span>';
} elseif ($blue['status'] == 3) {
echo
' | '$txt['status'], ':<span style="background-color:#FFFFB0">&nbsp;'$txt['confirmed'], '&nbsp;</span>';
} elseif($blue['status'] == 4) {
echo
' | '$txt['status'], ':<span style="background-color:#C8C8FF">&nbsp;'$txt['assigned'], '&nbsp;</span>';
} elseif($blue['status'] == 5) {
echo
' | '$txt['status'], ':<span style="background-color:#CCFFCC">&nbsp;'$txt['resolved'], '&nbsp;</span>';
} else {
echo
' | '$txt['status'], ':<span style="background-color:#E8E8E8">&nbsp;'$txt['closed'], '&nbsp;</span>';
}
}

echo
'
</li>
</ul>'
;
}
$smcFunc['db_free_result']($dbresult);
?>

Edited: This document was successfully checked as XHTML 1.0 Transitional!
« Last Edit: July 05, 2011, 03:45:15 PM by Blue »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #1 on: May 13, 2009, 06:06:31 PM »
Nice job with this! ^^

Though, I think I can help you make it a bit.. cleaner.

For all those "1" or "0" choices, you can use "true" or "false". That way, when checking the variable, you can just put if ($var), as PHP assumes you're checking to see if the boolean is true or false.

For all the echo strings that result after a condition, you don't need to encase them in brackets. Example:

Code: [Select]
if ($var)
   echo 'hello';

This is the same as doing it with brackets. You'd use brackets if you're tying multiple strings together, such as;

Code: [Select]
if ($var)
{
    echo 'hello';
    echo 'moose';
}

When you called that while() to loop the information from the db, you're looping each row and column along with making those conditional statements. A suggestion would be to store the information into one major array(), and then free the result. After that, you'd proceed to echo the information.

About the query, you shouldn't be using double quotes for SMF 2.0 queries anymore. Use single quotes, and then define the limit as {int:limit}, and then parse a conditions array after the query.

Eg,

Code: [Select]
// Let's grab some database results
$dbresult = $smcFunc['db_query']('', '
SELECT
i.id_issue, i.subject, i.id_project, i.status, i.issue_type, i.id_reporter, i.replies, m.real_name, m.id_member, p.name
FROM {db_prefix}issues AS i
LEFT JOIN {db_prefix}members AS m ON (i.id_reporter = m.id_member)
LEFT JOIN {db_prefix}projects AS p ON (i.id_project = p.id_project)
ORDER BY id_issue DESC
LIMIT {int:limit}',
array(
'limit' => (integer) $limit,
)
);

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #2 on: May 15, 2009, 09:43:43 AM »
Thanks CCB ;D

I'll update the code and try what i've learned from you in it when my college exams are finished :)

And I'm glad you liked the block eheh ;D
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline Sordell Media

  • Semi Newbie
  • *
  • Posts: 8
    • Sordell Media
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #3 on: November 04, 2009, 08:56:43 PM »
Apologies if this isn't the right place to report issues with custom blocks.

I just tried adding this to my board (SMF 2.0 RC2, SP 2.3.1), and the block is reporting "Simple Portal not found". I'm guessing this is because the file "/SPortal2.php" has possibly been renamed since this block was created. I've only just started using SP so not sure what this file was/is now, can someone let me know what I'd need to change this to?

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #4 on: November 04, 2009, 08:59:12 PM »
Replace the code below:
Code: [Select]
if (!file_exists($sourcedir . '/SPortal2.php'))
With this code:
Code: [Select]
if (!file_exists($sourcedir . '/PortalBlocks.php'))
Can't garantee that it will work with the newer version of SimplePortal, but that will stop the error message.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Sordell Media

  • Semi Newbie
  • *
  • Posts: 8
    • Sordell Media
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #5 on: November 04, 2009, 09:24:19 PM »
Ah yes, that cleared up the error but the block doesn't seem to be compatible with the newer SP version, it breaks the page. I'll tinker with it a bit and post back if I manage to get it to work for the newer version :D

Offline c23_Mike

  • Beta Tester
  • *
  • Posts: 168
  • Gender: Male
    • c23 Computer, Gaming & more
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #6 on: November 16, 2009, 01:15:54 PM »
Hi there !

Am I right when this site already uses this mod? So there should be a working version for SP 2.3.1 and SMF Project 0.4 ... can they post it here?  :D
I would also like to use it!

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #7 on: November 16, 2009, 04:56:41 PM »
Hi there !

Am I right when this site already uses this mod? So there should be a working version for SP 2.3.1 and SMF Project 0.4 ... can they post it here?  :D
I would also like to use it!

We aren't using this mod. The block that you see is a Custom PHP block coded by one of the team. I will pass your message onto the person who coded it, to see if they will post the code here.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #8 on: November 16, 2009, 06:35:28 PM »
Here is the Custom PHP code that we use at SimplePortal.net (with permissions from Sinan):
Code: [Select]
global $context, $settings, $project, $txt;

$block_parameters = array();

if ($return_parameters)
return $block_parameters;

loadLanguage('Project');

$project = 1;
$num_issues = 5;
$order = 'i.updated DESC';

$issues = getIssueList(0, $num_issues, $order, '1 = 1');

echo '
<table class="bordercolor issuetable" style="border-collapse: separate; border-spacing: 1px;">';

foreach ($issues as $issue)
{
echo '
<tr>
<td class="windowbg sp_center" style="width: 24px;">
<img src="', $settings['images_url'], '/', $issue['tracker']['image'], '" alt="', $issue['tracker']['name'], '" />
</td>
<td class="info issue_', $issue['status']['name'], '">
<h4>
', !empty($issue['category']['link']) ? '[' . $issue['category']['link'] . '] ' : '', $issue['link'], ' ';

if ($issue['new'] && $context['user']['is_logged'])
echo '
<a href="', $issue['new_href'], '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';

echo '
</h4>
<p class="smalltext">', !empty($issue['version']['link']) ? '[' . $issue['version']['link'] . '] ' : '', $txt['issue_status_' . $issue['status']['name']], $issue['is_assigned'] ? ' (' . $issue['assigned']['link'] . ')' : '', '</p>
</td>
</tr>';
}

echo '
</table>';

It was written for ProjectTools 0.3.3, so it doesn't work perfectly with Project Tools 0.4 (like the colours don't work ;)). I will be updating the block on SP.net sometime soon, so I'll post an updated copy when I do.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Sordell Media

  • Semi Newbie
  • *
  • Posts: 8
    • Sordell Media
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #9 on: November 17, 2009, 12:49:16 AM »
Awesome, thanks :D

One thing I noticed implementing this on my site, is that if you've got more than one project you need to comment out / remove the following line:
Code: [Select]
$project = 1;

Offline c23_Mike

  • Beta Tester
  • *
  • Posts: 168
  • Gender: Male
    • c23 Computer, Gaming & more
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #10 on: November 17, 2009, 03:22:23 AM »
Hi there !

Wonderful, tnx a lot!

Offline Nothingness

  • Jr. Member
  • **
  • Posts: 69
  • Gender: Male
  • I am...the architect of my own destruction...
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #11 on: April 02, 2010, 11:33:56 PM »
Can someone update this?  :P
It's outdate
"Do you wallow in self-pity, or do you learn to use the gifts God gave you and command fear and respect, and defend against those who would do us harm"

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #12 on: April 03, 2010, 11:46:53 AM »
The code Nath quoted should be working. I don't remember updating it on this site.
And slowly, you come to realize... It's all as it should be...

Offline Nothingness

  • Jr. Member
  • **
  • Posts: 69
  • Gender: Male
  • I am...the architect of my own destruction...
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #13 on: April 03, 2010, 02:46:17 PM »
The code Nath quoted should be working. I don't remember updating it on this site.
Yeah it does, but the relies and status are not showing
"Do you wallow in self-pity, or do you learn to use the gifts God gave you and command fear and respect, and defend against those who would do us harm"

Offline ramon.cutanda

  • Translator
  • *
  • Posts: 27
  • Gender: Male
    • videoedicion.org
  • SMF Version: 2.1
  • SP Version: None
  • EhPortal Version: 1.22
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #14 on: April 03, 2010, 10:47:14 PM »
Just great, thanks!

Offline Nothingness

  • Jr. Member
  • **
  • Posts: 69
  • Gender: Male
  • I am...the architect of my own destruction...
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #15 on: June 16, 2010, 05:43:03 PM »
Look like the codes is outdated...
"Do you wallow in self-pity, or do you learn to use the gifts God gave you and command fear and respect, and defend against those who would do us harm"

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #16 on: June 16, 2010, 11:56:51 PM »
The code Nath quoted should be working. I don't remember updating it on this site.
Yeah it does, but the relies and status are not showing

Look like the codes is outdated...

The code works perfectly for Project Tools 0.4.2, are you referring to the 0.4.3 update?
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Nothingness

  • Jr. Member
  • **
  • Posts: 69
  • Gender: Male
  • I am...the architect of my own destruction...
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #17 on: June 17, 2010, 12:11:42 AM »
Except for the colours?
"Do you wallow in self-pity, or do you learn to use the gifts God gave you and command fear and respect, and defend against those who would do us harm"

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #18 on: June 17, 2010, 12:21:52 AM »
The colours work fine as far as I can see. Its possible that they don't display correcting in a browser like IE though. Works fine in Firefox, Chrome and Opera under linux for me.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Recent bugs/features SMF Project (Issue Tracker)
« Reply #19 on: July 01, 2011, 04:04:06 PM »
Code updated to Simple Portal 2.3.3 and SMF Projects 0.5.3.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.