• Welcome to Simple Machines Community Forum. Please login or sign up.
December 04, 2021, 10:24:24 PM

News:

Check out the SMF Function DB!


SMF Articles

Started by SMFHacks.com Team, September 04, 2008, 04:03:00 PM

Previous topic - Next topic

Özgür

So Long

ttuu

Quote from: vbgamer45 on June 30, 2009, 02:00:36 PM
Quote from: ttuu on June 28, 2009, 03:58:24 PM
ok. i Waiting patiently.
send me PM.

what abaut this:
Quote from: ttuu on June 25, 2009, 04:38:00 AM
Possible that if there is no permission to see some articles in the category is also not see the category in the list of categories?
? its possible?
Will do. Going to be a couple days as I get the updates added.

ok thanks

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Özgür

Quote from: vbgamer45 on July 01, 2009, 08:10:59 PM
Quote from: [Daydreamer] on June 30, 2009, 02:12:43 PM
Quote from: [Daydreamer] on June 26, 2009, 02:02:12 PM
vbgamer can you add "article link" to linktree in new version ?
bump!
Not sure what you mean there is a linktree in it

Hmm :) Look at this
http://www.rockayseri.net/rk/articles/?sa=view;article=25

Linktree is
"ЯocKayseri » Forum » Makaleler » Metal Müzik"
But actually linktree should be
"ЯocKayseri » Forum » Makaleler » Metal Müzik » Tolkien'in Orta Dünyası"
So "article link" meaning http://www.rockayseri.net/rk/articles/?sa=view;article=25 should be included linktree. This url should linked article title. (Tolkien'in Orta Dünyası)
So Long

vbgamer45

Not sure if I want to repeat it. I could will think about it. It is kind of dead link.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Özgür

Quote from: vbgamer45 on July 01, 2009, 08:47:36 PM
Not sure if I want to repeat it. I could will think about it. It is kind of dead link.

Why dead ? Smf already use this style, am i wrong? O_o
"Simple Machines Community Forum > Customizing SMF > Modifications and Packages > SMF Articles"

Article page not have to any "current article link".
So Long

vbgamer45

Yeah its ok. I just don't get the point since you are already on that page you are adding a link back to the same page
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

vbgamer45

New update

Version 1.1
+Added settings to allow attaching images to articles
+Added more display information on the person making the comment
!Fixed bug with importing tiny portal articles for SMF 2.0
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Angelotus

July 07, 2009, 05:02:31 AM #348 Last Edit: July 07, 2009, 05:39:52 AM by Angelotus
Thanks vbgamer45 for the update. I have to do it manually though. What are the database changes for the attachments?

Oh, and where does it call the attachment in the view function???

function ViewArticle()
{
    global $txt, $context, $user_info, $scripturl, $smcFunc, $mbname, $user_info;
   
    // Check if the current user can view the articles list
    isAllowedTo('view_articles');
   
    $m_cats = allowedTo('articles_admin');
    $context['m_cats'] = $m_cats;
   
    if (!isset($_REQUEST['article']))
        fatal_error($txt['smfarticles_noarticleselected']);
       
    $article = (int) $_REQUEST['article'];
   
    if ($context['user']['is_guest'])
        $groupid = -1;
    else
        $groupid =  $user_info['groups'][0];
   
    // Show the articles in that category
    $dbresult = $smcFunc['db_query']('', "
        SELECT
            a.ID_ARTICLE, a.title, a.date, p.view, a.approved, a.rating, a.totalratings, m.real_name, a.ID_MEMBER,
             a.description, a.views, a.commenttotal, a.ID_CAT 
        FROM {db_prefix}articles AS a
        LEFT JOIN {db_prefix}members AS m  ON (a.ID_MEMBER = m.ID_MEMBER)
        LEFT JOIN {db_prefix}articles_catperm AS p ON (p.ID_GROUP = $groupid AND a.ID_CAT = p.ID_CAT) 
    WHERE a.ID_ARTICLE = $article LIMIT 1");
    $row = $smcFunc['db_fetch_assoc']($dbresult);
    $context['article'] = $row;
    $smcFunc['db_free_result']($dbresult);
       

    // Check Approval
    if ($row['approved'] == 0 && $m_cats == false && $row['ID_MEMBER'] != $user_info['id'])
        fatal_error($txt['smfarticles_err_articlenotapproved'],false);
   
    // Check if article is allowed to be viewed
    if ($row['view'] == '0' && ($m_cats == false && $row['ID_MEMBER'] != $user_info['id']))
        fatal_error($txt['smfarticles_perm_no_view_article'],false);


    $addarticle = allowedTo('add_articles');
   
    // MyArticles
    if ($addarticle && !($context['user']['is_guest']))   
        $context['articles']['buttons']['mylisting'] =  array(
        'text' => 'smfarticles_myarticles',
        'url' =>$scripturl . '?action=articles;sa=myarticles;u=' . $user_info['id'],
        'lang' => true,

    );

    // Search
    $context['articles']['buttons']['search'] =  array(
        'text' => 'smfarticles_search',
        'url' => $scripturl . '?action=articles;sa=search',
        'lang' => true,

    );
   
   
    // View Article Buttons
   
    // Edit Article
    if ($m_cats == true  || $row['ID_MEMBER'] == $user_info['id'])
        $context['articles']['view_article']['edit'] =  array(
        'text' => 'smfarticles_txtedit3',
        'url' =>$scripturl . '?action=articles;sa=editarticle&id=' . $article,
        'lang' => true,

    );

    // Delete Article
    if ($m_cats == true  || $row['ID_MEMBER'] == $user_info['id'])
        $context['articles']['view_article']['delete'] =  array(
        'text' => 'smfarticles_txtdel3',
        'url' => $scripturl . '?action=articles;sa=deletearticle&id=' . $article,
        'lang' => true,

    );
   
    // Link Tree
    $context['linktree'][] = array(
            'url' => $scripturl . '?action=articles',
            'name' => $txt['smfarticles_title']
        );
       
    GetParentLink($context['article']['ID_CAT']);
   
   
    $dbresult = $smcFunc['db_query']('', "
    SELECT
        pagetext
    FROM {db_prefix}articles_page
    WHERE ID_ARTICLE = $article LIMIT 1");
    $row2 = $smcFunc['db_fetch_assoc']($dbresult);
    $context['article_page'] = $row2;
    $smcFunc['db_free_result']($dbresult);
   
    // Display all user comments
    $dbresult = $smcFunc['db_query']('', "
        SELECT
            c.ID_ARTICLE, c.ID_COMMENT, c.date, c.comment, c.ID_MEMBER, c.lastmodified,
            c.modified_ID_MEMBER, m.posts, m.real_name, c.approved
        FROM ({db_prefix}articles_comment as c)
        LEFT JOIN {db_prefix}members AS m ON (c.ID_MEMBER = m.ID_MEMBER)
        WHERE c.ID_ARTICLE = " . $context['article']['ID_ARTICLE'] . " AND c.approved = 1   ORDER BY c.ID_COMMENT DESC");
    $comment_count = $smcFunc['db_affected_rows']();   
    $context['article_comments'] = array();
    while($row3 = $smcFunc['db_fetch_assoc']($dbresult))
        $context['article_comments'][] = $row3;
       
    $smcFunc['db_free_result']($dbresult);
   
    $context['article_comment_count'] = $comment_count;
       
    // Update Views
     $dbresult = $smcFunc['db_query']('', "UPDATE {db_prefix}articles
        SET views = views + 1 WHERE ID_ARTICLE = $article LIMIT 1");
   
    $context['page_title'] = $mbname . ' - ' . $txt['smfarticles_title'] . ' - ' . $row['title'];
   
    $context['sub_template']  = 'viewarticle';
}

vbgamer45

There is no attachments in the view page. You have the option to upload images. Then can click/drag the image into the article.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Angelotus

Quote from: vbgamer45 on July 07, 2009, 08:41:23 AM
There is no attachments in the view page. You have the option to upload images. Then can click/drag the image into the article.

Ok, cool. But where can I drag the uploaded image, is that in the add article template, or edit article template? Is that done with a javascript or something? I have to do it manually, that is why I ask.

vbgamer45

When you edit the article that is where it is done. For SMF 1.1.x you just click on the image and it adds. For SMF 2.0 you need to drag it to the editor.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Angelotus

Ok, that is clear. Have tried that out, but I see nothing, only the size and [delete] link. In the source I see the javascript is there, but there is no output.

spaceboy

Hello again.  Excellent mod here too.  Here are a couple things I wonder if are possible:

1. Sort on Last Edit - it's a nice option to sort on Date since the dates don't change with updates/edits
2. A report that shows all of the article links (urls I guess) along with the member name that created them.  Preferably a "downloadable report" like a delimited text file
3. Ability to "subscribe" to a members articles, perhaps a notification sent via email when new articles or edits are done
4. Ability to bookmark a specific article within the software (of course you could always bookmark it in your browser)

I apologize if any of this has been previously discussed.
Thanks.


Baloch


vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Mick.

I use this mod a lot.  Its a must have in my forum genre.

I guess i can showcase it..

http://www.chevyavalancheclub.com/index.php?action=articles


I use the PDF mod as well so the "Here you will find some of the mods done & submitted by CAC members.
Help us grow our library!,submit your own How-To.

Adobe Reader® Required
"  was added in the article.template.php

MaryLouW

I just installed SMF Articles - I think it would be the perfect module for a forum that has a lot of tutorials and such.

However, after installing it, there is no button on my links bar.  What must I do in order to get a button to show up?

Thank you in advance

Kindred

If you are running 1.1.x series of SMF and you are using a theme other than the default....   just like any other mod, you will have to manually apply theme changes to your custom theme.   This includes adding the articles button to the topnav.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

MaryLouW

July 21, 2009, 05:15:06 PM #359 Last Edit: July 22, 2009, 12:46:04 PM by MaryLouW
Thanks....  I think I will have to pass on that. I'm not very good at those manual things. 

Appreciate the fast response.

Advertisement: