News:

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

Main Menu

ssi.php

Started by johny000, August 24, 2008, 11:09:17 PM

Previous topic - Next topic

katib

#20
thanks  sperfish
Quote from: spearfish on October 10, 2008, 07:34:49 AM
wait... so that's included by default in 2.0?  neat!
I am waiting  :)
Quote from: [SiNaN] on October 10, 2008, 07:27:21 AM
Well, it would have been better if you had mentioned the version you are using. You should use 'replies' index. In your case $post['replies'].
Hello SiNaN
please can you elaborate more?!
I am totaly newbie  :(
the ssi.php version isnot mentionned anywhere
I attached here my ssi.php file
and this is the code I am currently using:

<?php
// ٌRecents topics Change the 20 to however many recent posts you want included
echo '
<div class="tborder" '
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' '''>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="catbg" height="32"><span style="font-family: Verdana, sans-serif; font-size: 140%; ">آخر المشاركات</span></td></tr></table>'
;


include('SSI.php');
$posts ssi_recentTopics(10null'vivo');
echo '
<table width="100%" class="bordercolor" cellpadding="8" cellspacing="0" border="0" style="margin-top: 1px;">
<tr class="windowbg2"><td class="windowbg" valign="middle">'
;
echo 
"<marquee direction='right' onMouseOver='this.stop()' onMouseOut='this.start()'>";

foreach (
$posts as $post) {
echo 
"<span style='color:black;'>{$post['link']} - </span>";
echo 
"<span style='color:green;'>{$txt['last_post']}: </span>";
echo 
"<span style='color:black;'>{$post['poster']['link']} </span>";
echo 
"<span style='color:black;'>{$txt['replies']}</span>";
echo 
"<span style='color:black;'>{$post['num_replies']} </span>&nbsp;&nbsp;.::.&nbsp;&nbsp;";
}

echo 
"</marquee></td></tr></table>";
?>
منتدى الحجاج ... منتدى للقراءة والكتاب
http://www.hijaj.net

katib

#21
Any help please
I dont know how to get ssi.ph version 2 mentioned by Spearfish

@SiNaN
Quote from: [SiNaN] on October 10, 2008, 07:27:21 AM
Well, it would have been better if you had mentioned the version you are using. You should use 'replies' index. In your case $post['replies'].
do you mean SMF version or ss.php file version ??
I am using SMF 2 beta 4
منتدى الحجاج ... منتدى للقراءة والكتاب
http://www.hijaj.net

[SiNaN]

If you are using SMF 2.0 Beta 4, then you should use the 'replies' index. That means, adding $post['replies'] to your code will display the replies to the topic.
Former SMF Core Developer | My Mods | SimplePortal

katib

Many many thanks SiNaN
than you  very much Spearfish

Finaly it works like a charme  :D using  $post['replies']
منتدى الحجاج ... منتدى للقراءة والكتاب
http://www.hijaj.net

johny000

hello  guys i'm back here if any way can make only one bored not all the forum like  bored Id 3 & 12 only now all the forum ?

[SiNaN]

In recentTopics() function:

Code (Find) Select
         AND ms.ID_MSG = t.ID_FIRST_MSG
      ORDER BY t.ID_LAST_MSG DESC


Code (Replace) Select
         AND ms.ID_MSG = t.ID_FIRST_MSG
         AND t.ID_BOARD IN (3, 12)
      ORDER BY t.ID_LAST_MSG DESC
Former SMF Core Developer | My Mods | SimplePortal

johny000

thank you soo much now i have one problem  there is limited in the subject from the forum  the i cant type  let say only 5 word so is there is any way i can show the post not the subject ?

this my code

<?php require("SSI.php"); ?>
<META http-equiv=Content-Type content="text/html; charset=windows-1256">
<META http-equiv=Content-Language content=ar-sy>
   <style type="text/css"><!--
     body {scrollbar-3dlight-color:black;
                scrollbar-arrow-color:black;
                scrollbar-track-color:black;
                scrollbar-darkshadow-color:black;
                scrollbar-face-color:black;
                scrollbar-highlight-color:black;
                scrollbar-shadow-color:black}
   --></style>

  </head>
<body bgcolor="#FFFFFF" text="#000080" alink="#000080" vlink="#000080" link="#000080">
<?php
// Change the 20 to however many recent posts you want included
$posts ssi_recentTopics(15null'array');
echo 
"<marquee direction='right' scrollamount='3'onMouseOver='this.stop()' onMouseOut='this.start()'>";
foreach (
$posts as $post)
echo 
"&nbsp;&nbsp;&nbsp;<a target='_blank' href='{$post['href']}'><FONT COLOR='#000080' >{$post['subject']}</FONT></a>&nbsp;&nbsp;&nbsp;";
echo 
"</marquee>";
?>


i have try to  chenge the  {$post['subject']}  to  {$post['poster']} or {$post['board']} or {$post['body']}
but still not working any help  thank you

Quote from: [SiNaN] on June 22, 2009, 05:11:45 PM
In recentTopics() function:

Code (Find) Select
         AND ms.ID_MSG = t.ID_FIRST_MSG
      ORDER BY t.ID_LAST_MSG DESC


Code (Replace) Select
         AND ms.ID_MSG = t.ID_FIRST_MSG
         AND t.ID_BOARD IN (3, 12)
      ORDER BY t.ID_LAST_MSG DESC


[SiNaN]

If you want to display the body of the post, try $post['preview] index.
Former SMF Core Developer | My Mods | SimplePortal

johny000

hello is me again ihave dane  it now is good but one   thing is not right here is my code
<?php require("SSI.php"); ?>
<META http-equiv=Content-Type content="text/html; charset=windows-1256">
<META http-equiv=Content-Language content=ar-sy>
</head>
<body bgcolor="#FFFFFF" text="#000080" alink="#000080" vlink="#000080" link="#000080">
<?php
// Change the 20 to however many recent posts you want included
$posts ssi_recentTopics(15null'array');
echo 
"<marquee direction='right' scrollamount='3'onMouseOver='this.stop()' onMouseOut='this.start()'>";
foreach (
$posts as $post)
echo 
"&nbsp;&nbsp;&nbsp;<a target='_blank' href='{$post['href']}'><FONT COLOR='#000080'>{$post['preview']}</FONT></a>&nbsp;&nbsp;&nbsp;";
echo 
"</marquee>";
?>



like you see i'm useing "<marquee direction='right' scrollamount
right b/c i'm useing arabic long so what hapening now the new post is not showing first is showing  last  how do i mike it  show first



Quote from: [SiNaN] on July 02, 2009, 09:43:26 AM
If you want to display the body of the post, try $post['preview] index.

[SiNaN]

I'm not sure what you mean but try this:

Code (Find) Select
foreach ($posts as $post)

Code (Replace) Select
$posts = array_reverse($posts);
foreach ($posts as $post)


If that doesn't give you want you are trying to achieve, you need to elaborate your request.
Former SMF Core Developer | My Mods | SimplePortal

johny000

thank you one more thing is ther is any way ican make it work like this website

http://aljazeera.net/Portal
i Attach  the Image so you know what i'm looking for



Quote from: [SiNaN] on July 13, 2009, 12:17:59 PM
I'm not sure what you mean but try this:

Code (Find) Select
foreach ($posts as $post)

Code (Replace) Select
$posts = array_reverse($posts);
foreach ($posts as $post)


If that doesn't give you want you are trying to achieve, you need to elaborate your request.


[SiNaN]

Please create a new topic for your other request. Marked as solved.
Former SMF Core Developer | My Mods | SimplePortal

Advertisement: