SMF Articles

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

Previous topic - Next topic

ApplianceJunk

Quote from: saw on September 15, 2011, 04:03:10 AM
Great mod - thank you!

I'd like to remove the date and views from the actual article header (but keep the 'Submitted By'). Is that possible? Which code should I remove or alter?

Quote from: vbgamer45 on September 15, 2011, 09:07:26 AM
It would be in themes/default/Articles.template.php

Quote from: saw on September 15, 2011, 09:57:50 AM
Thanks, I found that, but unfortunately I'm not a coder; I need to be pointed to the actual code to remove.

I wanted to do the same thing.
I found and removed this code in themes/default/Articles.template.php


echo '<tr class="windowbg">
<td><span class="smalltext"><b>',$txt['smfarticles_submittedby2'],'</b>', '
<a href="',$scripturl, '?action=profile;u=',$context['article']['ID_MEMBER'],'">', $context['article']['real_name'], '</a>
<b>',$txt['smfarticles_date2'],'</b> ',

timeformat($context['article']['date']), '

<b>',$txt['smfarticles_views2'],'</b> ',

$context['article']['views'], '

</span>
</td>
</tr>';

ApplianceJunk

I'm trying to learn how to remove the link tree and search button shown on the article page in the attachment.

I'm looking in themes/default/Articles2.template.php but can't seem to find the right code.

Any help would be greatly appreciated.

Thanks,

vbgamer45

In the sources folder in articles.php
This code controls the linktree

// Setup the Link Tree
$context['linktree'][] = array(
'url' => $scripturl . '?action=articles',
'name' => $txt['smfarticles_title']
);

GetParentLink($cat);



For the top bar with search controlled by this call
ShowArticlesBar();
In the articles2.template.php in themes/default folder
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

ApplianceJunk

#783
To remove the link tree I found this code instead in Sources/articles.php


// 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);


and commented out this part.


/*
$context['linktree'][] = array(
'url' => $scripturl . '?action=articles',
'name' => $txt['smfarticles_title']
);

GetParentLink($context['article']['ID_CAT']);

*/


I tried first playing around with the code you posted, but I could not seem to get the link tree removed by removing any of that code.
Should what I did above effect anything other then removing the article link tree?

Thanks for the help,

Edited to add:

Quote
For the top bar with search controlled by this call
ShowArticlesBar();
In the articles2.template.php in themes/default folder

That worked perfect for me.

Thanks again.

SMFHacks.com Team

Update
2.0.1
!Fixed possible undefined error on the search page
+Added future integration support for Badge Awards
Disclaimer: SMFHacks.com Team is not affiliated with the SMF Team or the SimpleMachines NPO.
SMFHacks.com -  Paid Modifications for SMF
Latest Mods:
Community Suite
Newsletter Pro SMF Gallery Pro SMF Classifieds SMF Store

Manicred

How do you publish articles to the front page of the site? I am using Simpleportal. Thanks.

vbgamer45

Would require a custom php block to fetch article information.
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

mageguild

I would like to uninstall this mod from my site.  When I do, I get no errors.  However, the Articles Configuration link in the admin remains behind and all articles errors start giving fatal errors (EG:  http://www.thetennisbulletin.com/forums/articles/sa=view;article=13)

Fatal error: require_once() [function.require]: Failed opening required '/home/tbassett/webapps/thetennisbulletin/forums/Sources/Articles2.php' (include_path='.:/usr/local/lib/php') in /home/tbassett/webapps/thetennisbulletin/forums/index.php on line 371

Can anyone suggest anything to resolve this?

mageguild

Quote from: mageguild on August 12, 2012, 07:52:06 PM
I would like to uninstall this mod from my site.  When I do, I get no errors.  However, the Articles Configuration link in the admin remains behind and all articles errors start giving fatal errors (EG:  http://www.thetennisbulletin.com/forums/articles/sa=view;article=13)

Fatal error: require_once() [function.require]: Failed opening required '/home/tbassett/webapps/thetennisbulletin/forums/Sources/Articles2.php' (include_path='.:/usr/local/lib/php') in /home/tbassett/webapps/thetennisbulletin/forums/index.php on line 371

Can anyone suggest anything to resolve this?

I have had to re-install this mod to resolve all these fatal errors which is why my example link above now works.  I have attached a screenshot of the error. 

Kindred

looks like ti's not completely uninstalling, obviously. :P

you'll have to manually check files to confirm removal of the code
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

SMFHacks.com Team

2.0.2
!Fixed top articles bar layout issue in chrome for SMF 2.0
Disclaimer: SMFHacks.com Team is not affiliated with the SMF Team or the SimpleMachines NPO.
SMFHacks.com -  Paid Modifications for SMF
Latest Mods:
Community Suite
Newsletter Pro SMF Gallery Pro SMF Classifieds SMF Store

Apllicmz

Thanks
when Update dont forget portuguese file

<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
    <operation error="ignore">
        <search position="after"><![CDATA[?>]]></search>
        <add><![CDATA[
// Begin SMF Articles Text Strings translate by Candidosa2
$txt['smfarticles_menu'] = 'Artigos';
$txt['smfarticles_admin'] = 'Configura&ccedil;&atilde;o dos artigos';

$txt['smfarticles_articlessettings'] = 'Defini&ccedil;&otilde;es';
$txt['smfarticles_approvearticles'] = 'Aprovar artigos';
$txt['smfarticles_form_approvecomments'] = 'Aprovar Coment&aacute;rios';
$txt['smfarticles_catpermlist'] = 'Lista de Permiss&atilde;o da categoria';
$txt['smfarticles_txt_import'] = 'Importar';

$txt['permissiongroup_smfarticles'] = 'SMF Artigos';
$txt['permissiongroup_simple_smfarticles'] = 'SMF Artigoss';

$txt['permissionname_view_articles'] = 'Ver artigos';
$txt['permissionhelp_view_articles'] = 'Define se o utilizador pode visualizar os artigos.';
$txt['cannot_view_articles'] = 'Voc&ecirc; n&atilde;o pode exibir a p&aacute;gina de Os artigos.';

$txt['permissionname_add_articles'] = 'Adicionar artigo';
$txt['permissionhelp_add_articles'] = 'Se o utilizador pode enviar artigos';

$txt['cannot_add_articles'] = 'Voc&ecirc; n&atilde;o pode adicionar artigos.';
$txt['permissionname_edit_articles'] = 'Editar artigos pr&oacute;prios';
$txt['permissionhelp_edit_articles'] = 'Se o utilizador pode parar de editar os artigos';

$txt['cannot_edit_articles'] = 'Voc&ecirc; n&atilde;o pode editar Os artigos.';
$txt['permissionname_delete_articles'] = 'Apagar artigos pr&oacute;prios';
$txt['permissionhelp_delete_articles'] = 'Se o utilizador pode apagar artigos';
$txt['cannot_delete_articles'] = 'N&atilde;o &eacute; poss&iacute;vel apagar Os artigos.';

$txt['permissionname_articles_comment'] = 'Deixe coment&aacute;rios';
$txt['permissionhelp_articles_comment'] = 'Permite ao utilizador deixar coment&aacute;rios em um artigo.';
$txt['cannot_articles_comment'] = 'Voc&ecirc; n&atilde;o tem permiss&atilde;o para deixar coment&aacute;rios.';


$txt['permissionname_articles_auto_approve'] = 'Aprovados os artigos automaticamente';
$txt['permissionhelp_articles_auto_approve'] = 'Se os artigos dos utilizadores s&atilde;o auto aprovado quando submetidas.';

$txt['permissionname_articles_autocomment'] = 'Auto aprovar os coment&aacute;rios';
$txt['permissionhelp_articles_autocomment'] = 'Coment&aacute;rios n&atilde;o precisa esperar pela aprova&ccedil;&atilde;o.';

$txt['permissionname_rate_articles'] = 'Artigos Classifique';
$txt['permissionhelp_rate_articles'] = 'Se o utilizador pode clasifcar Os artigos';
$txt['cannot_rate_articles'] = 'Voc&ecirc; n&atilde;o tem permiss&atilde;o para classificar os artigos.';

$txt['permissionname_articles_admin'] = 'Administra&ccedil;&atilde;o de artigos';
$txt['permissionhelp_articles_admin'] = 'Utilizador pode gerir os artigos';
$txt['cannot_articles_admin'] = 'Voc&ecirc; n&atilde;o tem permiss&atilde;o para gerir os artigos.';
// END SMF Articles Strings     Support PT SMFPT   
]]></add>
    </operation>
</file>
<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
    <operation error="ignore">
        <search position="after"><![CDATA[?>]]></search>
        <add><![CDATA[
// Begin SMF Articles Text Strings translate by Candidosa2
$txt['smfarticles_menu'] = 'Artigos';
$txt['smfarticles_admin'] = 'Configura&ccedil;&atilde;o dos artigos';

$txt['smfarticles_articlessettings'] = 'Defini&ccedil;&otilde;es';
$txt['smfarticles_approvearticles'] = 'Aprovar artigos';
$txt['smfarticles_form_approvecomments'] = 'Aprovar Coment&aacute;rios';
$txt['smfarticles_catpermlist'] = 'Lista de Permiss&atilde;o da categoria';
$txt['smfarticles_txt_import'] = 'Importar';

$txt['permissiongroup_smfarticles'] = 'SMF Artigos';
$txt['permissiongroup_simple_smfarticles'] = 'SMF Artigoss';

$txt['permissionname_view_articles'] = 'Ver artigos';
$txt['permissionhelp_view_articles'] = 'Define se o utilizador pode visualizar os artigos.';
$txt['cannot_view_articles'] = 'Voc&ecirc; n&atilde;o pode exibir a p&aacute;gina de Os artigos.';

$txt['permissionname_add_articles'] = 'Adicionar artigo';
$txt['permissionhelp_add_articles'] = 'Se o utilizador pode enviar artigos';

$txt['cannot_add_articles'] = 'Voc&ecirc; n&atilde;o pode adicionar artigos.';
$txt['permissionname_edit_articles'] = 'Editar artigos pr&oacute;prios';
$txt['permissionhelp_edit_articles'] = 'Se o utilizador pode parar de editar os artigos';

$txt['cannot_edit_articles'] = 'Voc&ecirc; n&atilde;o pode editar Os artigos.';
$txt['permissionname_delete_articles'] = 'Apagar artigos pr&oacute;prios';
$txt['permissionhelp_delete_articles'] = 'Se o utilizador pode apagar artigos';
$txt['cannot_delete_articles'] = 'N&atilde;o &eacute; poss&iacute;vel apagar Os artigos.';

$txt['permissionname_articles_comment'] = 'Deixe coment&aacute;rios';
$txt['permissionhelp_articles_comment'] = 'Permite ao utilizador deixar coment&aacute;rios em um artigo.';
$txt['cannot_articles_comment'] = 'Voc&ecirc; n&atilde;o tem permiss&atilde;o para deixar coment&aacute;rios.';


$txt['permissionname_articles_auto_approve'] = 'Aprovados os artigos automaticamente';
$txt['permissionhelp_articles_auto_approve'] = 'Se os artigos dos utilizadores s&atilde;o auto aprovado quando submetidas.';

$txt['permissionname_articles_autocomment'] = 'Auto aprovar os coment&aacute;rios';
$txt['permissionhelp_articles_autocomment'] = 'Coment&aacute;rios n&atilde;o precisa esperar pela aprova&ccedil;&atilde;o.';

$txt['permissionname_rate_articles'] = 'Artigos Classifique';
$txt['permissionhelp_rate_articles'] = 'Se o utilizador pode clasifcar Os artigos';
$txt['cannot_rate_articles'] = 'Voc&ecirc; n&atilde;o tem permiss&atilde;o para classificar os artigos.';

$txt['permissionname_articles_admin'] = 'Administra&ccedil;&atilde;o de artigos';
$txt['permissionhelp_articles_admin'] = 'Utilizador pode gerir os artigos';
$txt['cannot_articles_admin'] = 'Voc&ecirc; n&atilde;o tem permiss&atilde;o para gerir os artigos.';
// END SMF Articles Strings     Support PT SMFPT   
]]></add>
    </operation>
</file>



vbgamer45

Thanks translation will include it in next one.
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

ollybaba

Hi, I'd like to allow users to have permission to post and edit articles based on post-count-based membergroups, not regular membergroups. Is there a way to do that? The only groups showing up in my permissions settings for this plugin are the regular membergroups.

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

ollybaba

So then, there's no way to automatically allow anyone to add or edit articles? An administrator has to add them to a membergroup manually before they can have that ability?

vbgamer45

You would use the regular members permissions in the membergroup settings to setup the permissions for adding/editing articles etc.
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

Vincent Volmer

Hello SMF Hacks,

Could you please fix the 'share on Facebook' button? It's not working correct (same issue as there was in the Gallery??).
It likes the website, not the article.

Thanks,
Vincent

vbgamer45

Quote from: Vincent Volmer on February 12, 2013, 09:16:32 AM
Hello SMF Hacks,

Could you please fix the 'share on Facebook' button? It's not working correct (same issue as there was in the Gallery??).
It likes the website, not the article.

Thanks,
Vincent
What error are you getting?

I am not using the share button in the articles system but instead the like code.
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

Vincent Volmer

Quote from: vbgamer45 on February 12, 2013, 12:45:42 PM
What error are you getting?

I am not using the share button in the articles system but instead the like code.

You are right (of course ;) ) it is the "Like" button.

Issue is, when I 'Like' an article it does not 'Like' the article ( in our case: digiscrap.nl/articles/overig-digitaal-scrappen/digiscrap-dutch-choice/65 ) but it Likes the website only (digiscrap.nl) on Facebook, not the article. Tweet on Twitter works OK!

Maybe you can change the Like button into the Share button? ....


Advertisement: