SMF Articles

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

Previous topic - Next topic

Kindred

what version of SMF are you using?   The mod supports that standard SMF permissions...   if a user belongs to ANY group with "allow" and NO group with "deny" then they should be able to access the articles.
Сл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

What type of washing machine is September?

An autumnatic. :)

mattchewone

If i post up my subs.php when i get home can you please take a look at it.

Many Thanks

Matt

willerby

What type of washing machine is September?

An autumnatic. :)

mattchewone

Sorry about the delay here is the subs.php

Thanks

willerby

mattchewone,

Subs.php attached is correct for standard SMF Articles install. Try upoloading it and checking that you have a simgle Articles tab on your menu that takes you to http:///(forumurl).../index.php?action=articles.

Let me know if that works then we'll get the category id's of photography and photoshop and set up the tabs as you want them

If that subs.php doesn't work, I would uninstall and reinstall SMF Articles as another php file is the cause and it will take too long to find. On uninstall you may get an error on a file - if so, stop the uninstall process, make a note of the error and post that file here.

W
What type of washing machine is September?

An autumnatic. :)

mattchewone

Thanks Willerby,

Here is there error when uninstalling -

4.   Execute Modification   ./index.php   Test failed
   1.   Replace   ./index.php   Test failed

I have attached the index.php also.

Matt

willerby

Ok Matt, there's your error. The index.php file changes for Articles aren't there. I've added them manually in this version attached.

Upload this file. Check to see if articles working. If so, let me know the category id's of the articles sections you want on your tabs and what you want them called and I'll amend subs.php for you.

If articles still not working correctly, uninstall the articles mod (again if an error let me know and post the file but should uninstall ok now). Then reinstall articles completely.

We're nearly there now...

What type of washing machine is September?

An autumnatic. :)

mattchewone

Fantastic, just uploaded it and it works fine again, what was it that changed?

Here is the URL for the photoshop -  index.php?action=articles;cat=1
Here is the URL for the Photography - index.php?action=articles;cat=2

Thanks so much Willerby

Matt


willerby

Good.

If you go to the mod page and click on the PARSE button it shows you the changes to each file. The index.php file has an articles array action edit - a simple addition of the line

'articles' => array('Articles2.php', 'ArticlesMain'),

That wasn't in your index.php file hence why articles wouldn't work. It's also why the mod wouldn't uninstall - it couldn't find that line to delete it. The error on uninstall therefore tells you where the error is likely to be.

Here's the amended subs.php which will create two tabs - "Photoshop Articles" which points to category 1 and "Photography Articles" which points to category 2.

Upload this to the Sources directory (remember to keep a ~ tild copy of the now working version first) and check it works. If you want to change the tab labels edit the file in Notepad searching for those two tab labels and replacing them with whatever text you want.

{This edit does not use language files but hard codes the "labels" into the file. If your forum uses multiple languages come back to me as we will need to edit modifications.english.php and any other language files and change the subs.php code to refer to the relevant text references.}
What type of washing machine is September?

An autumnatic. :)

mattchewone

Thank you Willerby! I will get on and do this now!

Are you able to tell me how i ca add the ~ tilde to the original subs.php please i am still new to this.

Also i dont suppose you know if there is way to edit the articles display template so that it displays the articles under the category title for example, when you click the photoshop articles tab, it displays all the articles rather than a category link.

Thank you again!

willerby

If you are using ftp to upload files, go to the Sources directory and rename the original subs.php files as subs.php~  (tild symbol is above # key on my keyboard).

Then upload new subs.php.  If an error occurs when you check your site,  delete the new subs.php you uploaded and rename the original file back to subs.php by taking off the tild.


Re the articles display, thats what the code does I think... It will result in a list of all articles in that category. Let me know if that's not what you wanted...
What type of washing machine is September?

An autumnatic. :)

mattchewone

Thank you Willerby,

I have just put in the newly edited Subs.php and it works wonderfully! Its fantastic, now i will build them up with wonderful articles before i allow people to view them.

Thank you once again.

willerby

Quote from: willerby on May 14, 2009, 05:13:13 PM
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?

Still don't know if this is a bug. I think it is as all permissions ok. If I change the order of two member groups that a member belongs to (so that the one that was primary becomes secondary and vice versa) they can see articles one way but not the other. As that is just an order change not a change in  permissions I'd say this mod does not support secondary member groups...

If you agree, how do I fix?
What type of washing machine is September?

An autumnatic. :)

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

Angelotus

Quote from: Angelotus on May 06, 2009, 05:24:24 AM
Something else. In the view article template, how can I get the article ID?
I need it for social bookmark.

I tried this, but no luck:
<a href="http://nujij.nl/jij.lynkx?t=', $context['article']['title'], '&u=' , $scripturl , '?action=articles;sa=view;article=' , $context['article_id'] , '" target="_blank"><img src="http://nujij.nl/nu-jij-icon-16x16.gif" border="0" /></a>

Can I get some help with this please?

SimonSays

#296
I've been looking at using SMF Articles as a replacement for TinyPortal's news system, which still isn't close to readiness for SMF 2.0.

I've got a fresh install of SMF 2.0 RC1-1; along with the latest SMF Articles mod. The database is a copy of one which I'd used for TP .98 ('cause 1.0beta is flaky) -- which has been upgraded to SMF2.0RC1-1.  I've confirmed that TP articles are in the database

Whenever I try to use the SMF Article "Import TinyPortal" option, I get the following error:
Quote
Database Error
Table 'xxx_smf3.Arraytp_articles' doesn't exist
File: /home1/xxx/public_html/xxx/Sources/Articles2.php
Line: 2630
Line 2630 is
SELECT authorID ID_MEMBER, subject title, intro description, views, approved, date FROM {$tp_prefix}articles ");
Looking at the code, the trouble may be at line 2582 which defines the tp_prefix variable as:
$tp_prefix = $smcFunc.'tp_';
Unfortunately, I'm a php-neophyte, so I'm not sure what it should be doing. In reading this message about changes to database functions in SMF2, it appears that the code needs to be updated?

SimonSays

Quick follow-up. After playing with the code a bit, I figured out that the variable $tp_prefix was unneeded so  I commented out line 2582 (to keep the line numbering the same), and simply changed line 2630 to

SELECT authorID ID_MEMBER, subject title, intro description, views, approved, date FROM {db_prefix}tp_articles ");

and line 2635 to

FROM {db_prefix}articles AS a, {db_prefix}tp_articles AS t

Now all the TP articles are able to be imported into a single SMF Article category -- which isn't ideal, but I can eventually reassign them by hand. However another problem shows up: TP articles are in HTML; and do not seem to want to display as such in SMF Articles. Am I missing something-- such as a setting somewhere to turn on HTML in the articles?

Finally, it would be ideal for a proper import that the comments also be imported... they are stored in the table "tp_variables" (as are the actual TP categories) -- anyone able to take a stab at a way to copy these to the correct articles? (it should be similar to importing the TP articles themselves, right?)

Thanks ever so much!

Kindred

Articles does not allow HTML, for security...   just like forum posts, the articles need to have the HTML removed and/or converted to BBC.

(Yes, I have the same issue with 900 articles imported from a former joomla installation, but some of the work I did by exporting the articles table in a text file and then performing global replaces before dropping the table and importing the revised table.)
Сл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."

SimonSays

Quote from: Kindred on June 02, 2009, 08:28:36 AM
Articles does not allow HTML, for security...   just like forum posts, the articles need to have the HTML removed and/or converted to BBC.
I'm not clear what the security concern would be in removing HTML from the imported articles -- forum posts can be set to allow limited HTML. Does that mean that TP's implementation (Using FCKeditor) in its own article system is insecure?

It also makes this import quite a bit less useful, if the text has to then be re- (or pre)-edited. While I don't have 900, I do have about 300 articles; and I'm not looking forward to re-writing the articles in BB codes.

Unless Articles has a means to allow even a limited subset of HTML (as in forum posts), I'd be include towards looking at other options, such as using a WordPress front-end.

Advertisement: