Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Grudge on December 25, 2006, 04:01:55 AM

Title: Functionality requests for SSI in the next version of SMF
Post by: Grudge on December 25, 2006, 04:01:55 AM
All,

As part of the new features to be added in the next version of SMF I'd like to further expand the SSI functions available - but I need the communities input. Apologies in advance for not trawling through the countless threads that have no doubt requested things in the past but I would like to keep it all together - hence this topic.

So - what additions would you like to SSI in the next release? Are there any things you've been hacking in the last couple of years that you think should be part of the core code? If you can provide some suggestions I'll collect them all together - consider them with the team here - and let you guys know what the outcome will be.

Regards,

Grudge
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Daniel15 on December 25, 2006, 05:16:40 AM
The main thing I'd like would be a function to retrieve individual posts (I'm sure there's a mod for that somewhere, but I haven't looked around). Also, a variant of the ssi_recentTopics function, which accepts board ID's to include rather than exclude :).
I can't think of anything else at the moment, although I probably will later (I'll be back :P)
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Ben_S on December 25, 2006, 09:10:24 AM
Grab single message and an archive type feature would be great, by archive, I mean along the lines of http://www.redandwhitekop.com/archive.php http://www.redandwhitekop.com/archive.php?aid=646
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Rudolf on December 25, 2006, 09:54:42 AM
Here's one (http://www.simplemachines.org/community/index.php?topic=128584.0)
What the SSI needs is more flexibility, with the modified code I can write external pages just like they would be an extra action in the forum. With the current one it's bit more difficult.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: nitins60 on December 29, 2006, 12:41:43 PM
Code: [Select]
ssi_theme = "1";
there is no option for selection theme of forum, it doesn't matter theme number! When administrator change theme, so it should also change according to theme rather than changing theme number!
Code: [Select]
ssi_theme="auto"; something like s good!
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: yomasta3 on December 31, 2006, 08:34:39 AM
Just put everything in SMF_API.php into SSI.php. That would help me a ******load more then having 2 files that interfere with eachother. lol.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Grudge on January 01, 2007, 04:11:59 PM
Code: [Select]
ssi_theme = "1";
there is no option for selection theme of forum, it doesn't matter theme number! When administrator change theme, so it should also change according to theme rather than changing theme number!
Code: [Select]
ssi_theme="auto"; something like s good!
But if you simply don't set $ssi_theme then it will do auto anyway?
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: nitins60 on January 02, 2007, 12:13:35 AM
But i have tested it, there is some difference using ssi_theme! When i don't use this, it loads theme template, but doesn't retrieve style.Css!
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: 1MileCrash on January 02, 2007, 12:17:09 AM
I was thinking, wouldn't it be great if hitting "reply" to SSI_boardnews or the like brought us back to the page the function was on?

I have this: If it would appeal to others. Each topic in a specific board has a page automatically created with replies and a link added. I think it's alot like what ben has but i haven't looked at his really well yet.

http://model98.org/reviews.php?

Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Panzer- on January 04, 2007, 11:21:30 PM
There already is the ssi_menubar (Not sure on the exact name). I was wondering if there could be an ssi_boarddisplay, basically it would show the board and footer but no navigation bar/menubar/header. That way people could incorporate SMF into their websites easier.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: 1MileCrash on January 05, 2007, 05:19:23 PM
There already is the ssi_menubar (Not sure on the exact name). I was wondering if there could be an ssi_boarddisplay, basically it would show the board and footer but no navigation bar/menubar/header. That way people could incorporate SMF into their websites easier.

I had a similar idea a while back..It would be pretty cool.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Daniel15 on January 05, 2007, 08:10:34 PM
Quote
That way people could incorporate SMF into their websites easier.
What's wrong with using the layer system for incorperating SMF into a site?
Integrating the forum into your site... (http://www.simplemachines.org/community/index.php?topic=19638.0), second post :D
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Peter Duggan on January 05, 2007, 08:13:01 PM
Integrating the forum into your site... (http://www.simplemachines.org/community/index.php?topic=19638.0), second post :D

So why not link to it direct (http://www.simplemachines.org/community/index.php?topic=19638.msg158669#msg158669)? ;)
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Daniel15 on January 06, 2007, 01:08:24 AM
Integrating the forum into your site... (http://www.simplemachines.org/community/index.php?topic=19638.0), second post :D

So why not link to it direct (http://www.simplemachines.org/community/index.php?topic=19638.msg158669#msg158669)? ;)
I should have done that, but I used the Wiki link syntax ;)
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Panzer- on January 06, 2007, 01:48:42 PM
I think personally it would help non coders with their website - forum integration.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Sarke on January 06, 2007, 01:50:54 PM
Hi, new around these parts.  I'm in the process of switching from IPB and I'm having a hard time with missing features that I get from IPBSDK (http://ipbsdk.sourceforge.net/).  By no means is IPBSDK perfect, but it does make things much easier.  I hope you'll have a look at the functions it provides and consider making similar for SSI.

Below are some functions I find very useful and would like to see in SSI (remember I'm new to SMF so if these are already there forgive me).  They're not directly from IPBSDK but inspired by it, and it's how I would have done it (probably add "ssi_" infront of the function names):

list_members($group = '') returns an array of user ids with all the members in that group (or all members if $group is left blank).

list_online_members() returns an array of the members that are currently online.

topic_info($topic_id) returns an array with info on the topic, such as subject, topic starter, array of post ids in topic, array user ids who posted in it (perhaps have the user id as the key and the value as the number of post in the topic by that user).

post_info($post_id) returns an array with info on the post, just like mentioned earlier in this topic.

member_info($user_id = '') returns an array with info about the member. False if no $user_id is specified and if the current person is not logged in.

is_online($user_id = '') returns a true or false depending on if the specified user is online. If $user_id is blank, check to see if the person viewing the page is logged in. Sort of like a reverse is_guest() function.

is_admin($user_id = '') returns a true or false depending on the specified user (or current user if blank) is an admin.

is_in_group($group_array, $user_id = '') returns a true or false depending on if the specified user (or current user if blank) is in any of the member groups specified.

I know the last few you can get through $user_info, but not for any user specified and with a bit more code.  I should also note that I find (as I'm sure many do), for example, that

Code: [Select]
if (is_admin())
is more convenient than

Code: [Select]
if ($user_info['is_admin'])
even though it's just a small change.  Functions like that are easy to code so I suggest they be included for the sake of convenience.


Thanks for your time, and keep up the good work!
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Sarke on January 06, 2007, 01:59:41 PM
Another one...

name_to_id($user_name) returns the id.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Panzer- on January 06, 2007, 08:42:32 PM
IPBSDK is basically equivilant to the ssi. Except its a mod for IPB whereas its built in for SMF.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Daniel15 on January 07, 2007, 04:37:08 AM
Sarke, a lot of the things you've suggested already exist. I'll give you some code examples:

Quote
list_online_members() returns an array of the members that are currently online.
Code: [Select]
<?php
require('SSI.php');

$online ssi_whosOnline('array');
echo 
'<pre>'print_r($onlinetrue), '</pre>';
?>


Quote
member_info($user_id = '') returns an array with info about the member.
Code: [Select]
<?php
require('SSI.php');

// By ID:
loadMemberData(1);
loadMemberContext(1);
// At this point, $memberContext[user_id] contains the user's details
echo '<pre>'print_r($memberContext[1], true), '</pre>';

// By username:
$return loadMemberData('Daniel15');
$userID $return[0];
loadMemberContext($userID);
echo 
'<pre>'print_r($memberContext[$userID], true), '</pre>';


// If you really want a function to replicate that IPB-SDK functionality :-)
function member_info($member_id)
{
loadMemberData($member_id);
loadMemberContext($member_id);
return $memberContext[$member_id];
}
?>


Quote
is_online($user_id = '') returns a true or false depending on if the specified user is online.
It's in the array retrieved above

Quote
is_admin($user_id = '') returns a true or false depending on the specified user (or current user if blank) is an admin.
I believe this is also returned in the array above.

Quote
is_in_group($group_array, $user_id = '') returns a true or false depending on if the specified user (or current user if blank) is in any of the member groups specified.
All their groups are in the array returned above

Quote
name_to_id($user_name) returns the id.
Load the user's data (above), and then get the name :)

Also, note that there's heaps of information (especially on the current user) in the large $context array.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: B Patterson on January 17, 2007, 10:13:33 PM
Subscribed Topic Replies
I added this to my SSI.php for use with my index.php page.  Basically, instead of using TP (too much bloat for me) I created my own index.php page and then used SSI to power it.  I created a function to get the latest unread topics that you are subscribed to.  Basically, it comes down to something like this:
function ssi_unreadReplies($output_method = 'echo')
{
global $db_prefix, $context, $settings, $scripturl;

$topic_ids = array();
$last_msg_ids = array();
$return = array();

$request = db_query("SELECT MAX(lmr.ID_MSG)
FROM {$db_prefix}log_mark_read AS lmr
WHERE lmr.ID_MEMBER = " . $context['user']['id'] . "
LIMIT 0, 1", __FILE__, __LINE__);
list($max) = mysql_fetch_row($request);
mysql_free_result($request);

$request = db_query("
SELECT m.ID_TOPIC
FROM {$db_prefix}log_notify AS ln
LEFT JOIN {$db_prefix}messages AS m
ON ln.ID_TOPIC = m.ID_TOPIC
WHERE ln.ID_MEMBER = '" . $context['user']['id'] . "'
AND m.ID_MSG > '{$max}'
AND ln.sent = '1'
GROUP BY m.ID_TOPIC
ORDER BY m.posterTime DESC", __FILE__, __LINE__);

while($row = mysql_fetch_assoc($request))
{
$topic_ids[] = $row['ID_TOPIC'];
}
mysql_free_result($request);

if(!empty($topic_ids))
{

if(count($topic_ids)>1)
$wclause = "m.ID_TOPIC IN (" . implode(', ', $topic_ids) . ")";
else if(count($topic_ids == 1))
$wclause = "m.ID_TOPIC = '" . $topic_ids[0] . "'";

$request = db_query("
SELECT m.subject, t.ID_TOPIC,
t.ID_LAST_MSG
FROM {$db_prefix}topics AS t
LEFT JOIN {$db_prefix}messages AS m
ON t.ID_FIRST_MSG = m.ID_MSG
WHERE " . $wclause, __FILE__, __LINE__);

while($row = mysql_fetch_assoc($request))
{
$last_msg_ids[] = $row['ID_LAST_MSG'];

$return[$row['ID_TOPIC']]['topic'] = array(
'id' => $row['ID_TOPIC'],
'subject' => $row['subject'],
'short_subject' => shorten_subject($row['subject'], 30)
);

}
mysql_free_result($request);

$request = db_query("
SELECT m.posterName, m.posterTime, m.smileysEnabled, m.body, m.ID_TOPIC, m.ID_MSG
FROM {$db_prefix}messages AS m
WHERE m.ID_MSG IN (" . implode(', ', $last_msg_ids) . ")
", __FILE__, __LINE__);

while($row = mysql_fetch_assoc($request))
{

$row['body'] = parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']);

if (strlen($row['body']) > 512)
$row['body'] = substr($row['body'], 0, 512) . '...';

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

$return[$row['ID_TOPIC']]['post'] = array(
'poster' => $row['posterName'],
'timestamp' => forum_time(true, $row['posterTime']),
'time' => timeformat($row['posterTime']),
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.new;topicseen#new',
'preview' => substr($row['body'], 0, 102) . '...',
'body' => $row['body']
);
}
mysql_free_result($request);
}

if($output_method != 'echo' || empty($return))
return $return;

echo '
<table>
<tr>
<th>Subject</th><th>Poster</th><th>Posted</th>
</tr>';
if(!empty($return))
foreach($return as $topic)
{
echo '
<tr>
<table>
<tr>
<td style="border-top, border-left: 1px solid #000;">' . $topic['link'] . '</td>
<td style="border-top: 1px solid #000;">' . $topic['poster'] . '</td>
<td style="border-top, border-right: 1px solid #000;">' . $topic['time'] . '</td>
</tr>
<tr>
<td colspan="3" style="border: 1px solid #000; border-top: 1px solid #ccc; background-color: #ccc">' . $topic['preview'] . '</td>
</tr>
</table>
</tr>';
}
else
echo '
<tr>
<td colspan="3">No messages to display...</td>
</tr>';
echo '
</table>';
}

You can see this in action at www.roundcubeforum.net (http://www.roundcubeforum.net).  I love the feature it adds.  And so do my users.  When they log in from the front page, they can immediately see exactly what posts have been active for them.  This is very much the same as what vB has under the user Control Panel.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Daniel15 on January 17, 2007, 11:19:18 PM
Nice work, bpat1434 :)
Just a few things:
Code: [Select]
if(count($topic_ids)>1)
$wclause = "m.ID_TOPIC IN (" . implode(', ', $topic_ids) . ")";
else if(count($topic_ids == 1))
$wclause = "m.ID_TOPIC = '" . $topic_ids[0] . "'";

$request = db_query("
SELECT m.subject, t.ID_TOPIC,
t.ID_LAST_MSG
FROM {$db_prefix}topics AS t
LEFT JOIN {$db_prefix}messages AS m
ON t.ID_FIRST_MSG = m.ID_MSG
WHERE " . $wclause, __FILE__, __LINE__);
It should still work properly if the IN only has one ID in it, so something like this should still work:
Code: [Select]

$request = db_query("
SELECT m.subject, t.ID_TOPIC,
t.ID_LAST_MSG
FROM {$db_prefix}topics AS t
LEFT JOIN {$db_prefix}messages AS m
ON t.ID_FIRST_MSG = m.ID_MSG
WHERE m.ID_TOPIC IN (" . implode(', ', $topic_ids) . ')', __FILE__, __LINE__);

:)

Another minor thing:
Code: [Select]
if (strlen($row['body']) > 512)
$row['body'] = substr($row['body'], 0, 512) . '...';
SMF has a different way of doing this, which ensures that it doesn't cut the text off in the middle of a word or <br /> tag. It trims it to the nearest word. I can't remember the code, though

Quote
You can see this in action at www.roundcubeforum.net
You're the owner of www.roundcubeforum.net? I love Roundcube, it's got to be one of the best webmail programs. I've integrated it into my cPanel :D
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: B Patterson on January 17, 2007, 11:28:15 PM
I'm the operator and owner of www.roundcubeforum.net; however, I'm not the lead developer.  I'm just an avid user of RC and wanted to help out, so I created the forums.  You should join Daniel (if you haven't already).  I'm sure you could lend some advice to our not-so-technically-inclined visitors.... plus the look of roundcubeforum.net is going to change drastically.... I can't wait.  I get started tomorrow.  All the mods I've done in the past week have been for SMF for RCForum.... although I plan on releasing them generally.  None can be put in SSI.php though... pity...
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Ensiferous on January 30, 2007, 01:08:33 PM
Personally I'd work on getting better performance before implementing more features. First of all the require/include_once does not go well with an opcode cache, and smf should really be coded probably to not have to use it and instead use require/include. Granted, users might mess it up, but it could speed things up a bit.

Oh and here's some proof in forms of images of a cachegrind analyse.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg3.glowfoto.com%2Fimages%2F2007%2F01%2F30-1006377164T.png&hash=3ebef6222e6e4a38b9a3230c8351d1a2) (http://www.glowfoto.com/viewimage.php?img=30-100637L&y=2007&m=01&t=png&rand=7164&srv=img3) (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg3.glowfoto.com%2Fimages%2F2007%2F01%2F30-1007251995T.png&hash=1563c9bf21ff09212f861d68c192a94f) (http://www.glowfoto.com/viewimage.php?img=30-100725L&y=2007&m=01&t=png&rand=1995&srv=img3)
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: B Patterson on January 30, 2007, 04:20:41 PM
Why not use require_once or include_once?  They're there so that you can't accidentally " re-declare certain functions or overwrite variables inadvertently.  It's no slower than require, and no faster.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Ensiferous on January 30, 2007, 04:29:10 PM
I beg to differ. Logically it would be slower as it has to check if said file has already been included, however, that's marginal. What I actually said was it was slower when used with an opcode cache. Since you have no reason to believe me I'll send you to talks.php.net

Rasmus Lerdorf (php creator): http://talks.php.net/show/oscon06/8

"This is because include_once and require_once don't play nice with opcode caches right now. Changing to require brings us to 875 requests/second."

But that was merely one little thing I noticed from the quick profiling I did. There are probably larger issues at hand.

And in the future, if you're going to disagree on a subject it's smart to do some research, the other person might just know what he's talking about.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: B Patterson on January 30, 2007, 05:03:59 PM
Okay, I wasn't saying you were wrong.  I was just saying that to my understanding require_once/include_once were just as fast, or only a few milliseconds slower than require/include.  Never said I was the authority on the issue.

I wasn't aware of what exactly opcode cache was, so I read up on it.  Now I know, now I stand corrected.  Sorry for asking a question....
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Ensiferous on January 30, 2007, 05:25:07 PM
Sorry if I may have come off as being a bit arrogant, that really wasn't my intention. The issue that the SSI file could use some optimizing is still standing though. The smf_api.php file is great if you don't need fancy theme stuff, he blazing fast and will work with only minor modifications.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: B Patterson on January 30, 2007, 05:37:17 PM
I agree, SSI.php could use optimizing now too.  Now that I'm aware of exactly how "slow" it really is.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Daniel15 on January 30, 2007, 08:54:35 PM
NoFear, what utility are you using to profile the PHP script? It looks quite useful :)
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Ensiferous on January 31, 2007, 02:01:23 AM
I'm using the plugin Xdebug (http://www.xdebug.org) which generates a cachegrind file that can be analysed with kCacheGrind for linux or WinCacheGrind for windows. And it is very useful indeed.



Edit: Fixed broken url tag - Motoko-chan
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Vanscot on February 08, 2007, 08:45:39 AM
Well, I'll add a little bit here:

1 Originally was:

function ssi_welcome($output_method = 'echo')
{
        global $context, $txt, $scripturl;

        if ($output_method == 'echo')
        {
                if ($context['user']['is_guest'])
                        echo $txt['welcome_guest'];
                else
                        echo $txt['hello_member'], ' <b>', $context['user']['name'], '</b>',
allowedTo('pm_read') ? ', ' . $txt[152] .
' <a href="' . $scripturl . '?action=pm">' . $context['user']['messages'] . ' ' .
($context['user']['messages'] == '1' ? $txt[471] : $txt[153]) . '</a>' .
$txt['newmessages4'] . ' ' . $context['user']['unread_messages']
. ' ' . ($context['user']['unread_messages'] == '1' ? $txt['newmessages0'] : $txt['newmessages1']) : '', '.';
        }
        // Don't echo... then do what?!
        else
                return $context['user'];
}


My idea:

function ssi_welcome( $output_method = 'echo' ) {
global $context, $txt, $scripturl;

if( $context['user']['is_guest'] ) {
$buffer = $txt['welcome_guest'];
} else {
$buffer = '<a href="foro/index.php?action=profile;u=' .
  getUserID( $context['user']['name'] ).'">' .
  $context['user']['name'] . '</a><br />';
if( allowedTo( 'pm_read' ) ) {
$buffer .= 'Tienes ' .
   ' <a href="' . $scripturl . '?action=pm">' .
   $context['user']['unread_messages'] . ' ';
if( $context['user']['unread_messages'] == '1' ) {
$buffer .= ' mensaje';
} else {
$buffer .= ' mensajes';
}
$buffer .= '</a>';
} else {
$buffer .= '.';
}
}
if( $output_method == 'echo' ) {
echo $buffer;
} else { // Don't echo... then do what?!
return $buffer;
}
}


To put it clear, If I dont want something outputed (echo, print, etc) maybe i want it returned.
(array, var, string or bool return, so I can use it somwhere else.)

2 I would use a different approach to templates.
Here where I work, we use a like this:

<?php
//this is index.php
//logic and data processing.

include( template( '../templates/index.html' ) );

index.html looks like:

<html>
etc, etc,

<body>
{$variables_to_show}
Web structure.(tds, p, h1, etc)
</body>

</html>

The dirs looks like:

./include where functions and reusable stuff lives. (Hopefully, html, _SESSION, globals free functions)
./templates where all the templates lives.
./web where all the .php scripts are waiting to be called.

It's a nice and clean way to see the world and know what to change and where to change.
Maybe you can use that.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Sindorf on February 08, 2007, 03:26:51 PM
It would be better to add an option to SSI like grabbing topics (and/or messages maybe) in a single board using the output style of the function ssi_recentTopics. It becomes very hard to exclude_boards in ssi_recentTopics(); when you have over 50 boards :) Also exclusion have some problems (if you exclude all boards except one board, ssi_recentTopics shows a single message)

I will try to work on this type of function in a few weeks, but if anyone have such a system or have more time to work on this type of system, it will be welcomed! :)

Thanks. :)
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: bank robber on February 12, 2007, 02:30:06 PM
SMF IMHO, needs to be re-architectured heavily. PHP has support for classes now, using arrays and not having centralized load/save methods...is like zomg.

One of the functions I would like to see is centralize functions for Board, Post,Category. Sort of like convert the SSI to a centralize API.

in the SSI, have methods to modify a post, board, or category or any other object etc. It should all be centralized etc.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Daniel15 on February 13, 2007, 03:18:10 AM
Quote
PHP has support for classes now
Yes, but the class handling differs in PHP 5 compared to PHP 4 (look at JpGraph for instance -- It has two seperate versions, one for PHP 4, and the other for PHP 5).

Quote
One of the functions I would like to see is centralize functions for Board, Post,Category. Sort of like convert the SSI to a centralize API.

in the SSI, have methods to modify a post, board, or category or any other object etc. It should all be centralized etc.
SMF 1.1 started this (the createPost() function, etc), and it will be improved heavily in SMF Development Edition. I believe that all the main functions will be split into seperate PHP functions, making things like this a lot easier ;)
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Lastwebpage on February 28, 2007, 07:46:23 AM
Hello,
for some "external" websites, like wikis for example, or external "apps" like a Vista sidebar gadget, it would be usefull to get the search results somewhere, for example:
ssi_searchPosts("Search String",10); give me the first ten search results, in the form
< a href="Link to article">Topic</a>, or 10 link/title pairs if I use the array method.

I am not sure if this should be in the SSI, but for me this is the correct place for this.

Peter  
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Lastwebpage on March 10, 2007, 04:39:04 AM
One more:
an equivalent to boardNews for recentTopics, recentPosts
or/and a method to get a message (topic=1414;msg8989) back from SSI as "plain HTML", like the output from boardNews.

Both things throught URLs NOT throught "php only" functions.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Lastwebpage on March 14, 2007, 08:49:05 AM
the 3rd...
ssi_quickSearch($text); not only with this form element, because it fails with not PHP sites too.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: twistedsymphony on March 14, 2007, 10:10:46 AM
I've only been working with the SMF integration tools for about a month now and honestly I want to punch myself in the face and rip out my skull after the number of roadblocks and work around I've had to over come just for the simplest of tasks when integrading with other systems

1. prefix your functions - I've found no less then 5 SMF functions that conflict with other functions of the system I'm trying to integrate... I've told them to prefix their functions and now I'm telling you... it's just good practice when you're trying to develop an open ended system, you have no idea how many headaches this causes. if everyone prefixes then it makes for a happy developer.

2. instead of functions executing some code maybe they could just return a result, or result set. For instance ssi_showPoll() grabs the poll data, puts it in a table and then echos the table... if I want to tweak that data before I display it there's not much I can do. since the data is echoed from the function I cant analyze it or modify it I have to just let it display. which means the only thing I can use to control it is CSS. This is a problem also since the table is lacking any kind of identification, particularly because I have no way of knowing whether I've received poll options or poll results and I'd need different CSS depending on which one I've got. A much better option IMO would be to return the poll data as an array then I can do whatever I want with it... if you want to keep it simple so people can just plug in a function and get a tabelized poll fine maybe the poll function could have some options like sending a $format='T' returns a table 'A' returns an array and 'L' returns it in the much more CSS friendly List Item format. at very lead give me an id to work with.

I'd like to have this kind of flexibility with all of the data functions... give me an array with the results so I can do what I want with them.

3. Give me some options to put data INTO SMF.. not just take it out. I don't think it's too much to ask for a simple function where I can pass an array containing the user id, board id, post icon, title and content of a post and have it just show up on the forums.... or do that with a poll... or do that with a new news item... or do that with a new user to be registered... or do that for a user login... or any other function where I'd put information INTO SMF.

4. triggers: some way to have a function of mine triggered when something happens... when a new post is created, a new topic is created, a new user registers, the news changes... fire off my function so I can do something.

If you want to take this one step further this could be useful for plugins... except maybe it would intercept the data between the UI and plugins... so if a user creates a new topic... the topic data would be sent to my custom function FIRST then my function would return the same data after it was done doing its thing... Probably beyond the scope of SSI.php though.

WAY BEYOND THE SCOPE OF SSI.php:
IMO the most flexable applications are the ones that build an engine with an API and then build the UI using their own API... that way anyone can do anything through the API. and you could even trash the stock UI completely for something completely custom if you so desire.

While I know this kind of thing would be extremely difficult to do at this point the concept is important... think about the kind of things the UI needs to do when communicating with the rest of SMF... and give us that kind of control through SSI.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Ben_S on March 15, 2007, 09:13:35 AM
1> I beleive thats being worked towards with the next release.
2> SSI.php is already capable of returning the data as an array, eg ssi_boardNews(2,8,0,50,"array")
3> Use the createPost function <http://support.simplemachines.org/function_db/index.php?action=view_function;function=377> Include SSI.php, require sources/Subs-Post.php and away you go.
 
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Joshua Dickerson on April 08, 2007, 05:32:51 AM
Personally I'd work on getting better performance before implementing more features. First of all the require/include_once does not go well with an opcode cache, and smf should really be coded probably to not have to use it and instead use require/include. Granted, users might mess it up, but it could speed things up a bit.

Oh and here's some proof in forms of images of a cachegrind analyse.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg3.glowfoto.com%2Fimages%2F2007%2F01%2F30-1006377164T.png&hash=3ebef6222e6e4a38b9a3230c8351d1a2) (http://www.glowfoto.com/viewimage.php?img=30-100637L&y=2007&m=01&t=png&rand=7164&srv=img3) (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg3.glowfoto.com%2Fimages%2F2007%2F01%2F30-1007251995T.png&hash=1563c9bf21ff09212f861d68c192a94f) (http://www.glowfoto.com/viewimage.php?img=30-100725L&y=2007&m=01&t=png&rand=1995&srv=img3)
Sorry for reply to such an old post, but I have been profiling SMF myself for a while and I didn't notice similar results. Are you using relative paths?
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Sarge on April 12, 2007, 08:22:17 PM
Does ssi_recentTopics(), for example, have image/attachment support?

For example, some users attach images to their posts and some others prefer to include them using [img] [/img]tags. It seems to me that ssi_recent*() and ssi_boardNews() simply don't show images at all, whether hotlinked or attached.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: c2h5oh on April 13, 2007, 06:12:49 PM
How about adding an extra variable allowing UTF8 output (forced, via converter) - it would come in handy if forum cannot be converted - ie. recent posts are pulled via SSI at 2 websites, one being UTF8, the other not.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: mrskumfetish on April 16, 2007, 03:20:23 AM
i have an idea.. how about a refreshing "shout box" where members can chat right across any page they are on. thats is something sure to get members going.

also how about member rating profiles/pictures. where there will b a selected 10 main best of pictures 5 women 5 men
this may require alot of coding but im sure it can be done right? lol

wellanyway its jus a few suggestions hope mayb it an b done
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: mip69 on April 16, 2007, 04:28:12 AM
I would like a function for new replys/active topics in x hours.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: nitins60 on April 16, 2007, 04:30:31 AM
Does ssi_recentTopics(), for example, have image/attachment support?

For example, some users attach images to their posts and some others prefer to include them using [img] [/img]tags. It seems to me that ssi_recent*() and ssi_boardNews() simply don't show images at all, whether hotlinked or attached.

+1, i just want to pull attachments from the topics, show up as per permissions!
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: peterstannard on April 27, 2007, 07:03:25 AM
Hopefully I havn't missed the board.

Can I ask for the option to turn off the displaying of the stuff I have highlighted in the image below, the comments text, the post info text and the separator.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg300.imageshack.us%2Fimg300%2F9055%2Fssihd3.gif&hash=f95ba695c4c1cbc48bc38dbb9634492b)
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: mediman on April 27, 2007, 07:09:03 AM
Hopefully I havn't missed the board.

Can I ask for the option to turn off the displaying of the stuff I have highlighted in the image below, the comments text, the post info text and the separator.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg300.imageshack.us%2Fimg300%2F9055%2Fssihd3.gif&hash=f95ba695c4c1cbc48bc38dbb9634492b)

Use "array" instead "echo" as output and you can change the output to what ever you want.

mediman
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: motumbo on April 29, 2007, 12:25:30 AM
Quote
That way people could incorporate SMF into their websites easier.
What's wrong with using the layer system for incorperating SMF into a site?
Integrating the forum into your site... (http://www.simplemachines.org/community/index.php?topic=19638.0), second post :D

The layering system is complex to the point where I didn't understand it and couldn't get it to work right.  Looks like others felt the same.

I did a little experiement the other day.  What I did is renamed the SMF index.php file to index2.php.  Then, I created another index.php and included in the index2.php file.  The forum seemed to work OK.

In light of this, I was thinking what if it were possible to include in SMF into an existing website layout easily.  Say, a custom index.php could be made with an existing website's header, footer, and navigation panel and the SMF forum could be included in quickly.

Perhaps there could be a function that would include the entire SMF forum without the meta data, body tags, doc type, and other stuff.  Basically, just a way to very quickly include the forum in an existing layout.  A core function to just generate the basics of the forum without the entire page.



Title: Re: Functionality requests for SSI in the next version of SMF
Post by: 青山 素子 on April 29, 2007, 02:00:49 PM
Edit the index.template.php file to remove the extra content you don't want.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: motumbo on April 30, 2007, 12:07:01 AM
Edit the index.template.php file to remove the extra content you don't want.

Sure, that could be done.  And it's work.  That's how I integrated my forum into my site. 

But if there was a quick and simple function to include just the forum without the head and meta data, it would be nice.  That would be so simple and easy to integrate into an existing website that a small child could do it.

Easy is best.



Title: Re: Functionality requests for SSI in the next version of SMF
Post by: 青山 素子 on April 30, 2007, 12:58:30 AM
But different themes might handle things differently.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Alan S on May 20, 2007, 08:24:56 AM
I'd like to see the ability to SSI the calendar onto a page , Not just events from the calendar , The actual calendar.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: motumbo on May 23, 2007, 10:16:57 AM
But different themes might handle things differently.

I was thinking in terms of your own custom theme.

Have any of the developers of SMF seen what WordPress theme templating looks like? 
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: ladynada on May 30, 2007, 01:31:25 AM
Quote
That way people could incorporate SMF into their websites easier.
What's wrong with using the layer system for incorperating SMF into a site?
Integrating the forum into your site... (http://www.simplemachines.org/community/index.php?topic=19638.0), second post :D

The layering system is complex to the point where I didn't understand it and couldn't get it to work right.  Looks like others felt the same.

I did a little experiement the other day.  What I did is renamed the SMF index.php file to index2.php.  Then, I created another index.php and included in the index2.php file.  The forum seemed to work OK.

In light of this, I was thinking what if it were possible to include in SMF into an existing website layout easily.  Say, a custom index.php could be made with an existing website's header, footer, and navigation panel and the SMF forum could be included in quickly.

Perhaps there could be a function that would include the entire SMF forum without the meta data, body tags, doc type, and other stuff.  Basically, just a way to very quickly include the forum in an existing layout.  A core function to just generate the basics of the forum without the entire page.





I did something like that with the ultiportal theme but it was rejected and I was told that the SMF license agreement does not allow that.

nada
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: el canadiano on June 07, 2007, 07:18:45 PM
I want to see the News feed template to be editable
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: illustrationism on July 04, 2007, 12:04:59 PM
I know that some people have already mentioned this, but a way to grab posts from a topic would be nice... I'm about to build a function to do it myself, but something like this:

Code: [Select]
ssi_getTopic($topic = null, $limit = null, $start = null, $length = null, $output_method = 'echo')
...is what I'll be using.
Title: Re: what i think is
Post by: moneyearner on July 22, 2007, 09:01:52 AM
these items should come as standard now

ads (banner rotator) for advertising as standard
ad management                                as standard
or serparate file linked to admin so you input details and save it and its there like a codingpart say for google ads or just a banner rotator which can be turned off or on in admin

shop                                                  as standard

logo changer in separate file so it calls for it and then its easier to change
what i mean is if you put in the coding a file it has to call for then in that file named whatever you could change the code to call a different one its easier than mucking around with all the coding......

and in this maybe im just thinking about my self LOL

allan


Title: Re: what i think is
Post by: Peter Duggan on July 22, 2007, 12:35:24 PM
these items should come as standard now

ads (banner rotator) for advertising as standard
ad management                                as standard
or serparate file linked to admin so you input details and save it and its there like a codingpart say for google ads or just a banner rotator which can be turned off or on in admin

shop                                                  as standard

logo changer in separate file so it calls for it and then its easier to change
what i mean is if you put in the coding a file it has to call for then in that file named whatever you could change the code to call a different one its easier than mucking around with all the coding......

All bloat AFAIC (and not really SSI)! ::)
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: - GeO - on August 11, 2007, 01:59:48 PM
sorry if I didn't find it..
I'd like to see a mod that makes your forum looks like a portal  ... Tinyportal or something else..
Again - sorry if I posted  wrong.                                                 
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: ExcalibursZone on August 22, 2007, 12:16:42 PM
hmm, the strangest thing happened, my posts in this thread disappeared... *ponder* Well, here is the request again.

To repost then:
For functionality I'd request:
login($username, $password)
logout()
Does not display forms or links but are simple back-end functions that will log someone in and out of SMF from an external source. Not from a CMS, not by showing a form that you log into/out of, but something that can be called after including the SSI.php file in your custom login/out page.

Code: [Select]
<?
    require ('path/to/smf/SSI.php');
    if(!$_GET['logout'] && $_GET['action'] != 'login' && !is_loggedIn()) { /*...show my custom form... that points back to this file...*/ }
    if(!is_loggedIn() && $_GET['action'] == 'login') ssi_login($_POST['username'], $_POST['password']);
    if(is_loggedIn() && $_GET['action'] == 'logoff') ssi_logoff();
    ....
?>
That's the basic idea. I use my own form (or another form that is already created) then I go ahead and use the ssi_login() and ssi_logoff() functions to log the user into SMF at the same time. So if they have a browser window open to the forums, they can hit refresh and they're logged in because the cookies and everything is there. If they logoff and go back to the forum window, they refresh and they're logged out.

Thanks for writing what you have, I just think these two simple functions would make things easier for anyone writing their own custom bridges/login forms/or adapting a form that already exists.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: 青山 素子 on August 22, 2007, 12:38:37 PM
Sorry, I split your post since it went off topic. Check here: http://www.simplemachines.org/community/index.php?topic=190395.0



"Show new replies to your posts." on the top right is invaluable for keeping track of things.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: ExcalibursZone on August 22, 2007, 12:55:42 PM
I thought it was pretty much on topic since I was making a request and trying to make sure nobody kept telling me to use files and functions that currently do not fill the role for which I was requesting. *shrug* I guess it really wasn't a request if nobody thinks it can be done.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: 青山 素子 on August 22, 2007, 01:55:11 PM
Well, it started with the suggestion, but the whole rest of the discussion was off-topic.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Barons on August 23, 2007, 11:02:22 PM
Hello,

First of all, I want you to say you thanks for the great forum and community. This is my first post :)

Okay, I have thought about a mod that would take a topic and display their post.

(Okay, hum, sorry, this was not well explained)

Here is an exemple with my website.

My website: www.blood-feast.com
My forum: www.blood-feast.com/forum

Okay, so, If you go to: www.blood-feast.com/videos.php, you might notice a title named "Courts métrages [Horreur/Gore]". Under this category, I want to display  this http://www.blood-feast.com/forum/index.php/board,14.0.html and their inside FIRST post. (no comments or replies)
So, take a look.

You are under the "Courts métrages [Horreur/Gore]" section. This is what I want to display:

TEST
1st post of test + a link to the post for comments

TEST 2
1st post of test 2 + a link to the post for comments

i am not sure that you understood me, but, hum, please try to understand, if you have any question please reply. And if you have the solution, please reply too.

Thanks
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: MaBell37 on September 15, 2007, 02:49:18 PM
Hello, this is my first post in here.  I belong to a community that has private messaging (pm'ing), however, when you want to send a message to someone who is on a buddy list, you can't select anything like "Select Recipient from Buddy List".  Is there such a function, and, if not, is there any way to create one?

The purpose of my intent, is to make it possible when a site allows you to create a buddy list in the first place, to be able to use that same buddy list to add names to the addressing of pm's.  If this function already exists, please accept my apologies for wasting your time, but also please point me in the right direction so I may have my community add that feature to our web site.

Thank you for your time.

Rob

Ps.  I was directed to this site by one of the admins from my community who indicated to me that they get their site upgrades/features from here, but he was not familiar with my request.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: user2037 on September 18, 2007, 01:05:24 PM
Registration to simplify integration with other systems. Ideally with options to disable CAPTCHA (and e-mail verification, etc.) since the integrating system may already handle verification.

Expand "ssi_login" and "ssi_logout" to include the 'array' option so that the resulting parts can be formatted or styled without capturing output and altering it.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: daft_vada on October 08, 2007, 08:36:31 AM
id like to see an addon for the admin of the forum to use that outputs the code thats needed to make extra pages for the rest of their site like a login setup that uses the boards database fur the usernames
ive been looking for code like this to use on my site, im not really in any hurry for this code cos im yet to make the content for the members only section of the site
any help with this will be greatly apreciated
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: rockinaway on October 09, 2007, 03:45:43 PM
Much better poll handling..
Title: Encrypted Log-in - Re: Functionality requests for SSI in the next version of SMF
Post by: user2037 on October 23, 2007, 09:58:38 AM
It would be helpful if the SSI log-in provided the option to encrypt the log-in credentials. Even basic password hashing would be very helpful.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: wicked1234 on October 28, 2007, 01:08:47 PM
I would like to have some SSI for the time stamp that is in the upper right hand corner. That matches the user settings as the forums time stamp does.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Tangram on November 02, 2007, 05:12:58 AM
I would find an RSVP feature, something along the lines of www.meetup.com (e.g. photo.meetup.com/459.  We're a community that regularly get together and getting numbers together is tricky.  The voting options are OK, but not flexible enough for our needs.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Dannii on November 02, 2007, 05:20:42 AM
Hi Tangram, this topic is for functionality requests for SSI.php, not just any old general feature requests.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: 1MileCrash on November 10, 2007, 10:57:09 PM
If this hasn't been brought up before, i would LOVE to have SSI work like the templating system.

Like, SSI.php in source (or root where it is now)

and then an SSI.template.php. Then, subtemplates inside SSI.template for each function.

No more messing with arrays in the page you call it on, and now we can have a different SSI look for each theme (like when using layers, portals, and any other time you'd want SSI in a template).

Just something i find myself wanting from time to time.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: IrNbRu on November 11, 2007, 02:10:23 PM
hello guys i am new here but have read through the thread and there is a lot here for me to learn :D
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Panzer- on November 24, 2007, 03:22:22 AM
Could you give us a list/idea of what new SSI features will be in 2.0?
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: B Patterson on November 24, 2007, 11:31:54 AM
Tippmaster:  I could swear you can already do that... just declare $ssi_theme before including SSI.php....

I don't know if this is supposed to be leaked, but much of the multiple requested items in this thread should be in there.  I don't want to overstep my bounds, but SSI.php for SMF 2.0 is a lot nicer and includes many of the features requested in this thread.  If a member of the dev team says it's okay, then I'm sure they'll give you the info; until then, just know that it's got more and better functions ;)
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: 1MileCrash on November 24, 2007, 01:14:41 PM
Tippmaster:  I could swear you can already do that... just declare $ssi_theme before including SSI.php....

No..that's to use an SMF theme on a page by including SSI. I do that all over my site.

That's not what i mean, at all, try re-reading it. I'm talking about the structure of the SSI system itself, not a new feature.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: B Patterson on November 24, 2007, 02:32:57 PM
Okay... but you know that using SSI.template.php you'd just be messing with the arrays in a separate file right?  I mean, look at how SMF tempalting is done.  Array manipulation and loops is all it is.  So why use 3 file (or 4 if you're calling SSI.php from another file) when you can use just 2.  SSI isn't supposed to be a part of the SMF core, just a type of API to utilize some functionality of it.  Sounds like work for no real gain to me.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: 1MileCrash on November 24, 2007, 03:27:01 PM
Okay... but you know that using SSI.template.php you'd just be messing with the arrays in a separate file right?  I mean, look at how SMF tempalting is done.  Array manipulation and loops is all it is.  So why use 3 file (or 4 if you're calling SSI.php from another file) when you can use just 2.  SSI isn't supposed to be a part of the SMF core, just a type of API to utilize some functionality of it.  Sounds like work for no real gain to me.

Big gain. Now themes could style SSI outputs easier, people could edit them on their own easier, and it would just be better organized. You don't see any MYSQL stuff in the templates. SSI should have a source and a template file. The output (template) should be different from the page that initiates it and makes it happen (source)
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: imrich on December 04, 2007, 09:05:04 AM
I hope it's not too late to add a request.

I'd like to request that ssi_login() allow for the url to use when a user makes an error in their password or account name.

I tried to use ssi_login() on my site and it works perfectly when the proper credentials are provided. However when invalid credentials are provided, SMF comes up, which totally messes up my content.  If I could redirect the user to my own URL when bad credientials are provided (as you can when all goes well) I think I could have solved this issue.

Alternatively, or in addition to this (as someone else has requested provide a method to login and logout of the complete SMF system without any forms or output provided so I can format  all the the actual I/O myself.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Kiphaas7 on January 14, 2008, 09:26:28 AM
Okay... but you know that using SSI.template.php you'd just be messing with the arrays in a separate file right?  I mean, look at how SMF tempalting is done.  Array manipulation and loops is all it is.  So why use 3 file (or 4 if you're calling SSI.php from another file) when you can use just 2.  SSI isn't supposed to be a part of the SMF core, just a type of API to utilize some functionality of it.  Sounds like work for no real gain to me.

Big gain. Now themes could style SSI outputs easier, people could edit them on their own easier, and it would just be better organized. You don't see any MYSQL stuff in the templates. SSI should have a source and a template file. The output (template) should be different from the page that initiates it and makes it happen (source)

I would like to see this happen as well. I tried (and succeeded) into rewriting most of the ssi functions to proper html (no tables where they should not be), but figured that everything would break as soon as an update comes out (smf 2.0 for example).

I understand that it is much easier for those not so experienced with html to just call the function, but maybe both could be an option.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: haarrrgh on January 27, 2008, 12:40:59 PM
I would like an extended "show calendar" function for SSI.

The existing "Today's Calendar " displays something like this:

Quote
Future Birthdays: haarrrgh (27)
Future Events: Event1, Event2, Event3


I would like to have a list with dates and one event per line, like this:

Quote
2008-01-27 Event1
2008-01-28 haarrrgh's Birthday (27)
2008-02-01 Event2
2008-02-05 Event3

In addition, it should be possible to:
- choose how to order the list (by date ascending or descending)
- specify the format how the date is displayed, or display the date in the forum standard (I live in Germany, and in German the right format for the 1st of February is "01.02.2008").
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: 青山 素子 on January 27, 2008, 01:14:11 PM
haarrrgh, you can do most of that (except for the sorting, I believe) if you use the array output and actually do the layout of the information yourself.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: haarrrgh on January 27, 2008, 01:33:45 PM
Oh...ok  O:)

Sorry for spamming into this topic...I just discovered the SSI FAQ (http://www.simplemachines.org/community/index.php?topic=14906.0) topics right now (I did a search for "ssi" at docs.simplemachines.org before but didn't find anything, that's why I posted my request here. I didn't find the FAQ in the forums until now).

I will read the FAQs and ask my questions there.

Thank you for your help!
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: B Patterson on January 27, 2008, 03:01:19 PM
YOu can do the sorting through sort[/man] or usort ;) (http://php.net/sort)
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: mogama on February 06, 2008, 01:02:32 PM
Function request: Make it much easier to grant permission to a user for a specific board. For example: I search and find the user, then click in a box or link to set permission for that user for a particular board. Done!

Currently, it's taking me too long to grant access to a board to just some of my members. I did it before, then I forgot how to do it again. Can it be easier than this?

~mogama~
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: IchBin™ on February 06, 2008, 01:55:57 PM
This is not a feature request topic mogama. Its a topic for possible additional features added to SSI.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: ibookdb on February 13, 2008, 02:46:35 PM
Registration to simplify integration with other systems. Ideally with options to disable CAPTCHA (and e-mail verification, etc.) since the integrating system may already handle verification.

Expand "ssi_login" and "ssi_logout" to include the 'array' option so that the resulting parts can be formatted or styled without capturing output and altering it.

Yes I second this. We need ssi_register and better ssi_login/logout.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Gantry on March 03, 2008, 10:13:54 PM
Based on a recent set of posts that weren't answered, it would be nice to be able to control the output of the existing ssi functions so that I have the flexibility and choice of them returning:

(1) results as hyperlinks that open in current window (the default now),
(2) results as hyperlinks that open in a new window/tab, and
(3) results that display as text only, not hyperlinks.

I don't want the output of a birthday ssi to link to that forum user's profile, because users could theoretically click their way back to the forum in my Joomla iframe, which is ghastly.  I should have the simple option to choose the output.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: 青山 素子 on March 03, 2008, 10:41:14 PM
You can use the information however you want, just switch off the default echo mode and build your own layout with the information. It takes a bit more PHP understanding, but gives you huge flexibility.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: reanimationxp on March 04, 2008, 03:05:13 AM
I'd like to see additional information included in any function that pulls a post.

boardNews() currently does not pull "last edited" and other information when returning the post array. Any info such as dates and times, as well as links like replying to the topic should all be included.

Also, I agree with other users in that anything using a form (logging in, replying to a topic, etc.) should be able to be done via an SSI function. Basically any information the database stores should be able to be pulled via a function, which makes this idea sound more and more like an API.

Bottom line, I should be able to create a site using HTML and CSS, include SSI.php, and then pull any information the forum displays (anywhere) and format it the way I want, WITHOUT knowing SQL.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: ghosttr on March 16, 2008, 06:42:46 PM
I would like a register function added to the ssi so registrations can be handled out of the forums. I have made a makeshift ssi_register function but it still has some problems. Like redirecting to the forum after registration.

Title: Re: Functionality requests for SSI in the next version of SMF
Post by: ibookdb on March 20, 2008, 04:39:59 PM
I would like a register function added to the ssi so registrations can be handled out of the forums. I have made a makeshift ssi_register function but it still has some problems. Like redirecting to the forum after registration.


To reditect after registration, use the redirect line of code from the ssi_login. I'm not sure if it works or not but it should.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: ibookdb on March 20, 2008, 04:44:03 PM
haarrrgh, you can do most of that (except for the sorting, I believe) if you use the array output and actually do the layout of the information yourself.

Can we have this for echo and something else:

$output = 'blah';

switch ($mode) {
case 'echo':
  echo $output;
default:
  return $output;
}


Title: Re: Functionality requests for SSI in the next version of SMF
Post by: 青山 素子 on March 20, 2008, 05:08:11 PM
Can we have this for echo and something else:

$output = 'blah';

switch ($mode) {
case 'echo':
  echo $output;
default:
  return $output;
}

That's exactly the same thing, just one is echoed out directly, the other the output is formatted in a variable.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Spaceman-Spiff on March 20, 2008, 06:43:00 PM
ibookdb, you should use the array method so the function will return an array for you, and you can use it whichever way you please.

For example:
Code: [Select]
<?php

$topics 
ssi_recentTopics(8null'array');

for (
$i 0$i count($topics); $i++)
{
   echo 
'
         + <a href="'
$topics[$i]['href'], '">'$topics[$i]['subject'], '</a> '$txt[525], ' '$topics[$i]['poster']['link'], '<br />';
}

?>

You can check SSI.php for the full array objects, or do a print_r
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: ibookdb on March 20, 2008, 07:21:20 PM
yes but for ssi_login, which is the only ssi function I use there is no array output so I have to customize SSI.php each time. You could add case 'array' as another option wherever applicable. But most of the times just the output itself will do.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: dhimes on April 19, 2008, 08:31:35 AM

Yes I second this. We need ssi_register and better ssi_login/logout.

Me too.  It's difficult to hack.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: ibookdb on April 21, 2008, 12:35:06 PM
Can we have this for echo and something else:

$output = 'blah';

switch ($mode) {
case 'echo':
  echo $output;
default:
  return $output;
}

That's exactly the same thing, just one is echoed out directly, the other the output is formatted in a variable.

Yes it is exactly the same thing but it would be nice to have the control to decide when to output.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Hoochie Coochie Man on May 07, 2008, 06:30:32 PM
ibookdb, you should use the array method so the function will return an array for you, and you can use it whichever way you please.

For example:
<?php

$topics = ssi_recentTopics(8, null, 'array');

for ($i = 0; $i < count($topics); $i++)
{
   echo '
         + <a href="', $topics[$i]['href'], '">', $topics[$i]['subject'], '</a> ', $txt[525], ' ', $topics[$i]['poster']['link'], '<br />';
}

?>

You can check SSI.php for the full array objects, or do a print_r

Thankyou very much for this.
It works great.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: RileyHarper on June 01, 2008, 03:32:45 AM
I think it would be cool if all the boards had header and footer areas that you could edit while you're creating or modifying the boards. It would be a nice way to easily customize the boards without a lot of hassle. Thank you.  :)

-Rye
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: IchBin™ on June 01, 2008, 07:32:21 PM
RileyHarper, this isn't a suggestion topic for features. This is a suggestion topic for more functionality in SSI.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Enc0der on September 10, 2008, 04:56:59 PM
Is this thread still active & relevant?




I want to make a small change to the ssi_topTopics() function on SSI.php for SMF 2.0 beta 4.
I want to show the top topics by reply, but limit the results to topics that have started within the last X days only.

This will allow me to have a "hot topics" section on my homepage, that is always current and updated - without letting large topics from 3 years ago "stuck" in there forever...



I actually already did this change for the SSI.php of my current SMF 1.1.6, but I believe that now it's a bit different.. right?

Here is the new query that I did for SMF 1.x
The changed lines are bold:

    if ($modSettings['totalMessages'] > 100000)
    {
        $q = "SELECT topics.ID_TOPIC, ID_FIRST_MSG
            FROM topics
           INNER JOIN messages
            ON (topics.ID_FIRST_MSG=messages.ID_MSG)
            WHERE numReplies !=0
            AND posterTime >= " . (time() - $days * 86400) . "
            AND topics.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")
            ORDER BY numReplies DESC
            LIMIT 100";
        $request = db_query($q, __FILE__, __LINE__);
        $topic_ids = array();
        while ($row = mysql_fetch_assoc($request))
            $topic_ids[] = $row['ID_TOPIC'];
        mysql_free_result($request);
    }


I also added an index for the posterTime column on the 'messages' tables, to increase performance (by a HUGH difference), along with saving this to a static text file and update it hourly by a cronjob.
(I forgot to mention that I have a very large forum, over 3 million messages)

What is the easiest and most effective way to achieve this in SMF 2.0?


I also noticed that the SSI of SMF 2.0 doesn't have the $exclude_boards variables.
This is a shame, because I really likes to possibility to exclude off-topics boards from this function (even though the users have access to them).

Can I just add this line (and of course set the $exclude_boards array), and it will work?


Here is the original function of the SMF 2.0 version:
--------------------------------------------------

Code: [Select]
        $request = $smcFunc['db_query']('', '
            SELECT id_topic
            FROM {db_prefix}topics
            WHERE num_' . ($type != 'replies' ? 'views' : 'replies') . ' != 0' . ($modSettings['postmod_active'] ? '
                AND approved = {int:is_approved}' : '') . '
            ORDER BY num_' . ($type != 'replies' ? 'views' : 'replies') . ' DESC
            LIMIT 100',
            array(
                'is_approved' => 1,
            )
        );

Please guide me on how to make it exclude boards, and limit the results to X days.


Thank you![/hr]
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: [SiNaN] on September 13, 2008, 05:22:13 AM
I believe adding the 'posterTime' statement there as you did in 1.1.6 and using 'exclude_boards' is a good way to do this.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: rockgeek on September 15, 2008, 10:21:20 AM
Ability to list the posts of a specific thread outside on ther forums i.e. in a drupal node
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: [SiNaN] on September 25, 2008, 09:14:01 AM
http://custom.simplemachines.org/mods/index.php?mod=751
http://custom.simplemachines.org/mods/index.php?mod=662
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: rockgeek on November 02, 2008, 09:01:34 AM
Fatal error: Cannot redeclare db_query() (previously declared in /home/user/public_html/includes/database.mysql-common.inc:33) in /home/user/public_html/forums/Sources/Subs.php on line 98
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Enc0der on November 02, 2008, 05:43:24 PM
You have a conflict with another script on your website.. no quick solution for this as far as I know.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: darrenbeige on November 03, 2008, 12:44:18 PM
Seeing as V2.0 allows for custom profile fields, I think you should be able to retrieve those custom field values through SSI....

Thanks,

PS: And grabPost functionality like this: grapPost(topic=111.00) with array and echo modes
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: mule on November 15, 2008, 03:32:36 PM
I had a request/suggestion on how to make the calendar easier to use.    Once I enter information on the calendar, I am only
allowed to revise information that was originally typed in the text box.  I can't get in to change the date, the year, the title, the number of days to list the event, etc.  Since all the activities I have listed on the calendar are repeated the following year, that means I have to re-enter every single entry every year.  This is very time-consuming. Could you set it up so that any of the data can easily be revised in one screen?
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: IchBin™ on November 16, 2008, 08:39:11 PM
This is a suggestion topic for SSI requests. It doesn't have anything to do with the calendar. There's a suggestions board for any SMF suggestions you'd like to add.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: dazappa on May 13, 2009, 08:53:09 PM
ssi_recentPolls. Why's the current one limited to just one? ><
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: [SiNaN] on May 14, 2009, 10:48:46 AM
It is most probably because just few people would want to display more than one poll on the same page.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: TheDisturbedOne on June 12, 2009, 06:23:53 AM
How about the ability to archive posts in a different database.  I know there's a software that does this.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: significantpickle on November 01, 2009, 07:09:44 AM
How about a Woopra plug in for real time site analytics? It's at http://www.woopra.com
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: LaxnLatino on December 22, 2009, 02:24:11 PM
Is there a way to have more than one visible image for the member group(s) your in. Like i was in a clan for a while and you could be in multiple groups and have different images for each. I set that up on the forum i just created through you guys and it only shows my admin button
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Arantor on December 22, 2009, 02:25:46 PM
Is there a way to have more than one visible image for the member group(s) your in. Like i was in a clan for a while and you could be in multiple groups and have different images for each. I set that up on the forum i just created through you guys and it only shows my admin button

That's nothing concerning SSI. Please ask in the support board for your version of SMF.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: maharjanumesh on December 29, 2009, 05:33:26 AM
Well i don't know whether this one is discussed or solved or not

i have website, and i installed the forum in the sub-domain

i put the login code in the website

Quote
<?php

require ('forum/SSI.php');
ssi_login();

?>

but whenever members try to login, the page is directed to forum

is there anyway to use the Login function in such a way that, after login/logout, the page is not directed to forum and stay at website
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Arantor on December 29, 2009, 05:51:21 AM
What page do you want them to go back to, exactly? Put that URL in as a parameter to ssi_login like so:

Code: [Select]
<?php require('forum/SSI.php'); ?>
... other code goes here ...
<?php ssi_login('http://example.com'); ?>

Note that the call to require should be the very, very first thing in the page, even before any other HTML, to ensure it deals with cookies and sessions appropriately.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: maharjanumesh on December 29, 2009, 08:58:38 AM
^^

thank you very much it really helped me

is there any function to have the register account form, like login form


if yes please help me out
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Arantor on December 29, 2009, 09:03:20 AM
There is the SSI Register mod for 1.1.x, no-one has ported it to 2.0 yet (though I've been meaning to for a while)
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: maharjanumesh on December 29, 2009, 09:09:59 AM
^^

AGAIN THANK YOU VERY VERY MUCH

 :D

hope SSI register mode comes for  2.0 version also
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Arantor on December 29, 2009, 09:12:56 AM
It will if I can ever find time to take it over and fix it up...
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Lugial on January 11, 2010, 06:30:27 AM
Latest Banned member. That would be great.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Orphia on February 07, 2010, 10:24:35 PM
I'd like the search function to be able to search for topics started by user.  (Right now you need to know at least a word in the title.)

I know the stats page shows the list of top 10 topic starters, so it seems the software somehow keeps track of topic starters, but it would be useful to be able to find other users' threads, and your own.

I've done a fair bit of searching this site and can't find a mod that does this.

Kind regards,

Orphia.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Arantor on February 08, 2010, 02:19:15 AM
SMF 2 lets you see all the topics started by a user.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Orphia on February 08, 2010, 02:38:04 AM
SMF 2 lets you see all the topics started by a user.

Thanks very much, Arantor.  By SMF 2, do you mean SMF 2.0 RC2 Public?
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Arantor on February 08, 2010, 02:41:22 AM
Either 2.0 RC1 or 2.0 RC2 will do it, but yeah, stick with 2.0 RC2 Public.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: Orphia on February 08, 2010, 02:48:47 AM
Either 2.0 RC1 or 2.0 RC2 will do it, but yeah, stick with 2.0 RC2 Public.

Great!  Thanks very much.
Title: Re: Functionality requests for SSI in the next version of SMF
Post by: mosravo on July 30, 2013, 06:59:30 AM
what i want is to be able to create cusomize field having dynamic dropdown list based on the section of another dropdown list  like

Selecting State to get Local Government, selecting Local Government to get Constituency and getting the senator of that constituency.

Well i have been able go achieve this integrating it on my web site but i am still trying to understand how to create modes and integrate them.

I also want to a situation where one can click on a like button or link close to comment to like a comment.

Thank You.

Moses Oreva.