SMF Articles

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

Previous topic - Next topic

willerby

Quote from: mattchewone on May 12, 2009, 11:01:37 AM
Thank you Kindred.

Is it possible for someone to help with finding the part of themes/default/languages/modifications.english.php
That i would need to edit to change the name of the Tab.

$txt['smfarticles_menu'] = 'Articles';
What type of washing machine is September?

An autumnatic. :)

mattchewone

Quote from: willerby on May 12, 2009, 11:51:39 AM
Quote from: mattchewone on May 12, 2009, 11:01:37 AM
Thank you Kindred.

Is it possible for someone to help with finding the part of themes/default/languages/modifications.english.php
That i would need to edit to change the name of the Tab.

$txt['smfarticles_menu'] = 'Articles';

I just did this and it didnt work. I tested on 3 different browsers. Any reason why?

willerby

All language files load in cache memory so when you change them you have to clear the cahce so that the new language file is forced to load.

Go to ADMIN>MAINTENANCE>Forum Maintenance>Routine and last option is Empty the File Cache... click Run Task Now

When you go back to your forum home page click refresh on your browser and the tab will change

W
What type of washing machine is September?

An autumnatic. :)

mattchewone

Thank you very much that worked a treat.

Can i ask is it possible to have more than one article tab? Is it going to be possible also to have the article links and brief description under the category?

willerby

What type of washing machine is September?

An autumnatic. :)


Kindred

you can technically create as many tabs as you want (subs.php) however, you can only install articles once...   why do you want more than one tab?
Сл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."

mattchewone

Quote from: Kindred on May 12, 2009, 08:34:57 PM
you can technically create as many tabs as you want (subs.php) however, you can only install articles once...   why do you want more than one tab?

My forum is dedicated to Photoshop & Photography and i wanted a tab with articles for each. So they both had one category each and the articles listed below.

willerby

#268
Try this

Open Sources/Subs.php

Find:

// [Articles] button
'articles' => array(
'title' => $txt['smfarticles_menu'],
'href' => $scripturl . '?action=articles',
'show' => $context['allow_view_smfarticles'],
'icon' => '',
'sub_buttons' => array(
),
),


(or similar as I may have amended this slightly!)

Replace it with something similar to this...


// [Articles1] button
'articles1' => array(
'title' => "Photography Articles",
'href' => $scripturl . '?action=articles;cat=x ',
'show' => $context['allow_view_smfarticles'],
'icon' => '',
'sub_buttons' => array(
),
),
// [Articles2] button
'articles2' => array(
'title' => "PhotoShop Articles",
'href' => $scripturl . '?action=articles;cat=x ',
'show' => $context['allow_view_smfarticles'],
'icon' => '',
'sub_buttons' => array(
),
),


Change the text for whatever you want and change the cat=x to the number of the articles category/ies (go to each category and the id will appear in your browser url bar)

I think that will work

W
What type of washing machine is September?

An autumnatic. :)

mattchewone

Thank you i will give that a go as soon as i get home from work. Thank you

mattchewone

I tried this and i got both tabs, but i miss read the part about the cat=x and now i cannot view the articles at all. I deleted all the edits not sure where it has gone funny.

willerby

Try again - it needs a number for the article category in each case.

To avoid editing files back to their original state, save a copy on your server with a tild (~) on the end of the file name, upload your new amended file, check to see what's working and if there are errors just delete the uploaded file and take the tild off the original. That way you can experiment and always get back to where you were.

Go to the pages you want the tabs to link to and look at the url in the browser bar. It will say something like 'http://www.yourforum.com/forum/index.php?action=articles;cat=1'

Change the x in my code (both tabs) to the category number. You can delete the space after that and before the ' apostrophe.

This should work - does for me and I can't see anything on your site that would change this
What type of washing machine is September?

An autumnatic. :)

mattchewone

I cannot view the categories so i cannot tell what number they are,

Now i have gone back to the normal Subs.php (how it was before the edit) i cannot access the articles at all by clicking on the tab!

Thanks for the tip with adding the ~ (although i need to learn how to make a copy and add this)

Ann Anderson

I am on 1.18 and need to know how to make links live. All of my links are dead links in the area. I've used the bb code with the [url] but that have failed to work. thanks for your help.

vbgamer45

Where are you adding the links? In the article body?
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

willerby

Quote from: mattchewone on May 13, 2009, 04:15:35 PM
I cannot view the categories so i cannot tell what number they are,

Now i have gone back to the normal Subs.php (how it was before the edit) i cannot access the articles at all by clicking on the tab!

Thanks for the tip with adding the ~ (although i need to learn how to make a copy and add this)

You will need to get your .../Sources/Subs.php file back to the normal state that has articles in the menu. As you're unsure what edits have taken place best way is to go to the mod page, click on the Parse button and it shows you the following edits need to have taken place in your Subs.php file

Find:


$context['allow_calendar'] = allowedTo('calendar_view') && !empty($modSettings['cal_enabled']);


Add After:


$context['allow_view_smfarticles'] = allowedTo('view_articles');
      


Find:


'mlist' => array(
'title' => $txt['members_title'],
'href' => $scripturl . '?action=mlist',
'show' => $context['allow_memberlist'],
'sub_buttons' => array(
'mlist_view' => array(
'title' => $txt['mlist_menu_view'],
'href' => $scripturl . '?action=mlist',
'show' => true,
),
'mlist_search' => array(
'title' => $txt['mlist_search'],
'href' => $scripturl . '?action=mlist;sa=search',
'show' => true,
),
),
),


Add After:


// [Articles] button
'articles' => array(
'title' => $txt['smfarticles_menu'],
'href' => $scripturl . '?action=articles',
'show' => $context['allow_view_smfarticles'],
'icon' => '',
),



Once you get back to a steady state by checking you have all of these edits exactly as they are above in your subs.php file, you will be able to change the last edit above to the code I have given you.

Hope it works for you.

Always keep a copy of a file you are about to edit so you can go back to it...

W
What type of washing machine is September?

An autumnatic. :)

mattchewone

Thank you Willerby,

The code is all correct i checked that, when i click on the link for the articles, it comes up with the correct code in the URL bar - index.php?action=articles.php

What happens is the articles button gets highlighted as if it is on that page, then it just reloads the forum.

Matt

Kindred

Сл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."

willerby

As kindred says url link should be action=articles not articles.php

Check the subs.php again...
What type of washing machine is September?

An autumnatic. :)

willerby

vbgamer,

Does this mod support secondary membergroups eg. where a member belongs to more than one member group?

I have just set up an articles section for which only one member group can see. If that's their primary member group they can view but if its not (ie. its an additional group that they belong to) they cannot view...

I've checked member group permission and article permissions and all is correct.

Bug?
What type of washing machine is September?

An autumnatic. :)

Advertisement: