Hey guys, I want my users to be able to click an "Articles" link in the top menu, which would take them to a page listing all the categories available. I am using SMF 1.1.6 and TP 0.9.8. Thanks.
For that you would need to build a page and add your link for it to your theme.
There is an articlebox available in your TinyPortal admin panel, take a look at it to see if it will give you what you need.
Cool, would you be able to tell me which PHP file defines the look of the articles?
TPortal.template.php
Thanks man.
Okay, now I need serious help. When you search, it searches through the forums only, I need to make a search box that will search through all the categories and articles. Is this feature built-in or do I have to code it myself?
There is currently no search function on the articles.
Any clue why I am not getting the message?
/Checks to see if a specific category has been set
if(isset($_GET['cat'])) {
echo '<ul>';
//Foreach statement to display articles in a category
foreach($context['TPortal']['profile_articles'] as $art) {
if($art['catID']==$_GET['cat']) {
//Checks whether its empty
if ($art['subject']=='') {
//-----------------------MESSAGE!
echo '<p>No recepies have been added yet, please come back soon!</p>';
//-----------------------MESSAGE!
}
echo '
<li>' ,$art['subject'] , '';
echo '
</li>';
}
echo '</ul>';
}
} //End of specific category
I've tried everything, empty(), strlen($art['subject'] <=0)... nothing... I am absolutely puzzled.
Answer to what and where ?
Trying to pull articles for a categories set with "?cat=" in a custom action, is that what you meant?
I realized that the whole theory is wrong in that statement, the reason it wont echo it is because TECHNICALLY $art['subject'] is not empty, just the if statement prevents it from displaying, what I need to do is check if $_GET['cat'] exists in as a value in $art['catID']
This statement seems to work:
//Checks to see if a specific category has been set
if(isset($_GET['cat'])) {
echo '<ul>';
//Foreach statement to display articles in a category
foreach($context['TPortal']['profile_articles'] as $story) {
if($_GET['cat']==$story['catID']) {
$noarticles = 'F';
echo '
<li><a href="' . $scripturl . '?action=przepisy&page=' . $story['id'] . '">' , $story['subject'] , '</a><br />';
echo '
</li>';
}
}
echo '</ul>';
//Checks if there is no articles.
if($noarticles!='F') {
echo 'There is no articles!';
}
} //End of specific category