× Didn't find what you were looking for? Ask a question
Top Posters
Since Sunday
New Topic  
drfun Author
wrote...
10 years ago Edited: 10 years ago, drfun
You're absolutely right, my mistake Face with Open Mouth Try the following:

Replace:
Code:
ssi_recentTopics

With:
Code:
ssi_recentPosts

Using the previous code I showed you.

I have don this and its still same result as the first error i got with the first code you gave me for the Recently Updated Topic.

Can you check the raw code that is running this one on your forum?Neutral Face
Post Merge: 10 years ago

I have been looking at the code for quite some minute now, i decided to remove some code from this line 
Code:
$what = ssi_recentPosts('30', $bb,'array');
and it worked.
Here is what i removed  $bb,'array', but i dont know what is the function of this small piece of code in the main code as you have written. Here is the full code that worked
Code:
<div id="tcontent3" class="tabcontent">';

global $scripturl, $context, $settings, $txt, $modSettings;

// leave out the recycle board, if any
if(isset($modSettings['recycle_board']))
$bb = array($modSettings['recycle_board']);
else
$bb = array();

$what = ssi_recentPosts('30');

// Output the topics
echo '
<ul class="recent_topics" style="overflow: auto; margin-top: -1ex; padding: 0;">';

$coun = 1;

foreach($what as $wi => $w)
{
echo '
<li' , $coun<count($what) ? ' style="border-bottom: dashed 1px #bbb;"' : ' style="border: none; margin-bottom: 0; padding-bottom: 0; list-style-type: none;"'  , '>
<!--This should not be here, but I added it to include avatars-->
<span class="tpavatar"><a href="' . $scripturl. '?action=profile;u=' . $w['poster']['id'] . '">';

$w['poster']['avatar'] = str_replace('src','style="width: 35px; height: 35px;" src', $w['poster']['avatar']);

echo'',$w['poster']['id'] == '0' ? '<img src="'.$modSettings['default_avatar_url'].'" alt="default">' : $w['poster']['avatar'],'</a></span>

<a href="' . $w['href'] . '" title="' . $w['subject'] . '">' . $w['subject'] . '</a>
<br/>', $txt['by'], ' <b>', $w['poster']['link'],'</b> in <i>' . $w['board']['link'] . '</i>';
if(!$w['new'])
echo ' <a href="'.$w['href'].'"><img src="'. $settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="new" /></a> ';

echo '<br /><span class="smalltext">['.$w['time'].']</span>
</li>';
$coun++;
}
echo '
</ul>';

echo '</div>
More so i notice that the out come was not as arranged as the initial ones we did in both the Unanswered questions and the latest questions.
Bellow is a screenshot of how it look. May be you can help me improve on it
 Attached file 
Thumbnail(s):
You must login or register to gain access to this attachment.
All Student Forum
drfun Author
wrote...
10 years ago
Hello,
I am still waiting for your response.
All Student Forum
wrote...
Educator
10 years ago
My apologies, to be honest, I didn't get a notice that you had replied!

I will respond to this thread later on tonight or tomorrow at the latest. I won't be available today...
wrote...
Educator
10 years ago
Here is what i removed  $bb,'array', but i dont know what is the function of this small piece of code in the main code as you have written. Here is the full code that worked

What that does it prevent the showing of "recycled topics". Recycled topics are those that have been deleted and enter a new category automatically. This can be activated in the "Board" settings. If you don't activate this setting, deleting it will not cause any harm.

Quote
More so i notice that the out come was not as arranged as the initial ones we did in both the Unanswered questions and the latest questions.
Bellow is a screenshot of how it look. May be you can help me improve on it

You're saying the styling is off? In that case, you need to do what we did previous, that is, put it in a <table>. I think if you look at the previous examples, you'll see where to add these html tags. I will do it this last time, but from here on in, you need to compare and learn it on your own.

Code:
<div id="tcontent3" class="tabcontent">';

global $scripturl, $context, $settings, $txt, $modSettings;

// leave out the recycle board, if any
if(isset($modSettings['recycle_board']))
$bb = array($modSettings['recycle_board']);
else
$bb = array();

$what = ssi_recentPosts('30');

// Output the topics
echo '

<table style="width: 100%">
<td width="45%">Subject</td>
<td width="20%">Poster</td>
<td width="20%">Board Link</td>
<td width="15%">Timing</td></tr>';

foreach($what as $wi => $w)
{
echo '<tr>
<td>'.$w['subject'].'</a></td>
<td>'.$w['poster']['link'].'</td>
<td>'.$w['board']['link'].'</td>
<td>'.$w['time'].']</td>
</tr>
}
echo '</table>';

echo '</div>

Good luck.
drfun Author
wrote...
10 years ago
Thanks for the responds, i have inserted the code, its still the same as i reported earlier
Quote
More so i notice that the out come was not as arranged as the initial ones we did in both the Unanswered questions and the latest questions.
Bellow is a screenshot of how it look. May be you can help me improve on it

However i also notice that without this part of the code
Code:
// Output the topics
echo '

<table style="width: 100%">
<td width="45%">Subject</td>
<td width="20%">Poster</td>
<td width="20%">Board Link</td>
<td width="15%">Timing</td></tr>';

foreach($what as $wi => $w)
{
echo '<tr>
<td>'.$w['subject'].'</a></td>
<td>'.$w['poster']['link'].'</td>
<td>'.$w['board']['link'].'</td>
<td>'.$w['time'].']</td>
</tr>
}
echo '</table>';

It gives the same result.
All Student Forum
wrote...
Educator
10 years ago
So, what are you going to do to move forward here? Was there an error of some sort?
drfun Author
wrote...
10 years ago
No there was no error, i am going to use it like that, i will place the table just above it. it seems ssi_recentPosts is predefined in its table structure.

Ok lets move on, i will like the Marked solved or solved, and also Best Answer feature in the next lesson
All Student Forum
wrote...
Educator
10 years ago
The "Topic Solved" can obtained here: http://custom.simplemachines.org/mods/index.php?mod=1601

Is this what you're referring to?
drfun Author
wrote...
10 years ago
Thanks, i checked it out and its Compatible With: 2.0 RC4. I dont know if this will work on 2.0.5 version of smf. i will be glad if your can throw more light to it.
All Student Forum
wrote...
Educator
10 years ago
Thanks, i checked it out and its Compatible With: 2.0 RC4. I dont know if this will work on 2.0.5 version of smf. i will be glad if your can throw more light to it.

It should still work for your version. I'd try it using the package manager. If it gives you an error, don't go through with it, as it needs a bit of tweaking. Anyway, it still won't turn out the way it works here because the one that works on this forum was a custom modification. The one I directed you to works similar to the way it is found on SMF (their official website).
drfun Author
wrote...
10 years ago
ok, it requires some manual modification to get it working or to emulate the  2.0 RC4 version on the 2.0.5 version of smf.

What about the best Answer, is there a mod for it too?
All Student Forum
wrote...
Educator
10 years ago
What about the best Answer, is there a mod for it too?

I used this: http://custom.simplemachines.org/mods/index.php?mod=710

But, with *many* modifications to get it to look the way I have it here.
drfun Author
wrote...
10 years ago
ok, thanks i will give it a try.
All Student Forum
  New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1306 People Browsing
Related Images
  
 519
  
 506
  
 471
Your Opinion
Which industry do you think artificial intelligence (AI) will impact the most?
Votes: 352