News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Expert SSI FAQ

Started by Tomer, June 28, 2004, 07:31:34 PM

Previous topic - Next topic

Sting

Quote from: JayBachatero on October 23, 2005, 08:33:30 PM
check if Help     Use subdomain independent cookies are on in admin > features and options

That did it, thnx.

JayBachatero

Quote from: Sting on October 23, 2005, 09:28:25 PM
Quote from: JayBachatero on October 23, 2005, 08:33:30 PM
check if Help     Use subdomain independent cookies are on in admin > features and options

That did it, thnx.

You welcome.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Sting

#62
ok I think I remember reading this somewhere but with the search being disabled I can't find it. Now that that works I cannot logout.

EDIT: Ok, I cleared cookies and it fixed it.  :P

Sting

ok, this is a request I guess you would say. Earlier in another post I inquired about a way to use the ssi_boardNews() function to show particular posts inside of a board. Since I was unable to get a response to it I would assume that the ssi_boardNews() function does not allow for this and I am now requesting that if someone has some spare time could they code an ssi_boardTopics() function. If I knew what I was doing I would attempt it myself... but yea...

Ok, here's exactly what I want:

example: In an instance where multiple topics have been posted under a board, I want it to show a particular post, not just the first. I would assume it would pull it the same way ssi_boardNews() would as far as designating which to use (ssi_boardNews(15) for example).

If someone knows how to do this already please let me know, and if you would like to try this and need more infor I will be glad to provide it.

psychophat

I'm trying to make this work somebody please help, I'm new to PHP and I wish to make this work:

Saw this code and tried to put an else statement which is wrong.

<?php 

if ($context['user']['is_logged'])
{
   
echo ''$context['user']['avatar']['image'], '';
else echo 
'ssi_login();' }
  ?>


What I want it to show username and avatar if not show the login boxes in 1.1RC2 like in the very top of this page and also I want to have the Hey, membername, you don't have... ah, sorry I want the top part you see in this forum where the login boxes changes to login info to appear in my other pages so that they'll know if they have a message plus they can see their avatar, can this be done using SSI?

Heheheh hehe . . . the PHP book that I bought is glowing I think it wants me to read it, I'm scared I might get burned.
I adore this forum, from zero PHP knowledge to +.1% per post
I'm going to get the charter member thinggy when I get to save some cash
SMF v.1.1RC2
PHP v.4.3.11

psychophat

Man I love this forum, I should have not bought that PHP book I'm already learning from reading the posts and trying them out even if I continue to get errors I'm still learning somthing the do's and don't still far from learning it all but I'm stepping forward .1% at a time. Heheheh heh . . .

I didn't touch the thick PHP glowing book instead I've retried several posibile codes and would you know it the part that was wrong was the } placement. Geez, I'm so, so, so zero knowledgeable in PHP.

Okay got it working ah, can someone tell me how to add the following to the script?

Hey, membername, you don't have any messages...
Total time logged...
Show unread posts since last visit...
Show new replies to your posts...

Basically its like the top part of this forum and could anyone point me to the direction or CSS codes for the above parts that I need to modify in size and font (.ssi_??? codes to put in CSS file).

Thank you in advance,


-Patrick Grey
I adore this forum
I adore this forum, from zero PHP knowledge to +.1% per post
I'm going to get the charter member thinggy when I get to save some cash
SMF v.1.1RC2
PHP v.4.3.11

Acf

Is there a way to make this work in ssi?

theme_copyright()
Sigh...

kegobeer

Quote from: ªcF on January 30, 2006, 06:18:03 PM
Is there a way to make this work in ssi?

theme_copyright()

Does it not work?  I can't check it out at this moment.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Acf

Quote from: kegobeer on January 30, 2006, 07:39:55 PM
Quote from: ªcF on January 30, 2006, 06:18:03 PM
Is there a way to make this work in ssi?

theme_copyright()


Does it not work?  I can't check it out at this moment.

it doesnt work in yesterdays cvs :|
It only works with the " $forum_version = 'SMF';" hack around...
Sigh...

paki

Just thought I would update this here since I had some trouble finding it in the first place.

To make the membergroup check work on the forums, use this instead of the code posted:

if (in_array(###, $GLOBALS['user_info']['groups']))

where ### is the membergroup ID number.

Searched a lot and found it in this thread: http://www.simplemachines.org/community/index.php?topic=26899.0

Just thought I would try and help out anyone who may be looking for that.. I will be using it for the ads on my forums as well
http://www.dfwhyundais.com <-- Dallas/Ft. Worth's Local Hyundai Group

bashmyex

Could someone give a Smarty Template Engine Example for use with SSI.php?

Preferrably for ssi_recentTopics()
Thanks!

bashmyex

Ahh nevermind. I was making it more complex then it had to be.

Simply doing the below works for me:

PHP Side:

$smarty->assign ("recent_forum_topics", ssi_recentTopics(5, 0, 'array'));


Template Side:
   
    {foreach from=$recent_forum_topics item="recent_topic"}
         {$recent_topic.subject} //do same for each row you want displayed
    {/foreach}

Nicc

Just wanted to say thanks for these great guides! This SSI.php-file opens up a whole lot of possibilites - I love it!

- Nicc

humanporkrind

ok trying to get a php page to pull the theme info and I keep getting errors

<?php

$ssi_gzip 
false;
$ssi_ban true;
$ssi_theme '15';
$ssi_layers = array('main');

ob_start();

require(
"C:\Program Files\EasyPHP1-8\www\Smf 1.1 final/SSI.php");

?>

<embed src="http://www.xxxxxxxx.com/xxxx/xxxxx/xxxxxxx.mp3" autostart="true" loop="true"
hidden="true" />
<div align="center">
  <p><img name="Header" src="http://www.devilsrejectsdod.com/untitled4.jpg" width="85%" height="412" alt=""></p>
  <div align="left"></div>
  <table width="613" height="472" border="0" align="left">
    <tr>
      <th scope="row"><?php ssi_recentPosts(); ?><div align="left"></div></th>
    </tr>
  </table>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
</div>


See Screen shot for out put.

perplexed

Humanporkrind did you ever fix this problem as I have seen someone with a similar problem, and would like to know the answer.  thanks

Scrambled Egg

Would love to have a poll on my board home page, but this stuff is just too difficult for me.

[SiNaN]

Quote from: Tomer on June 28, 2004, 07:31:34 PM
**PLEASE DO NOT EDIT YOUR 'SSI.PHP' FILE**
Everything done here is done without having to edit 'SSI.php'


Why we mustn't edit our SSI.php?
Former SMF Core Developer | My Mods | SimplePortal

spottedhog

It is OK, to add new SSI calls to the bottom of the file, however, it is not necessary to modify any of the original SSI code.  You can use the variables called in SSI to make your own way of displaying the data. 

For example, on the basic ssi_boardNews() I made my own News module.  Here is the code to give you an example:

$array = ssi_boardNews($board = $newsboard, $limit = 5, $start = null, $length = 500, $output_method = 'array');

     

if (empty($array))

   echo _NOTOPICSPOSTED;



foreach ($array as $news)

{

echo '

<div style="width:100%" class="option">

        ', $news['icon'], '&nbsp;<b>', $news['subject'], '</b><br />

<span style="font-size:x-small">Posted On:&nbsp;&nbsp;', $news['time'], '</span><br />

<span class="option">', $news['body'],' <a href="', $news['href'], '">', _READMORE ,'</a></span></div><br />

<span style="font-size:smaller">', $news['link'], $news['locked'] ? '' : ' | ' . $news['comment_link'], ' |

<a href="forum/index.php?action=post;board=', $newsboard ,'">', _POSTNEWSARTICLE ,'</a></span><br /><br />';



if (!$news['is_last'])

echo '<hr style="width:50%;text-align:left; margin: 0 auto 0 0" /><br />';



}

[SiNaN]

Is it because that makes upgrade hard? Is is the only reason?
Former SMF Core Developer | My Mods | SimplePortal

spottedhog

It is not about being "hard".  It is about not being necessary.  All the ssi functions pull all the existing data and places it into variables.  Then all you need to do is to call the ssi function by "array" instead of "echo".

In other words, all the info needed to display is already being called, so why modify something when it is not needed?

Advertisement: