News:

Wondering if this will always be free?  See why free is better.

Main Menu

SMF Articles

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

Previous topic - Next topic

Minare

vbgamer, how will we update it? ( without losing existing db )

vbgamer45

Just upgrade to the latest release. Uninstalling does not delete database entries
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

ttuu

i try to attach image in article i cannot see the image in the article view.
if i try to edit article i see in bottum page X in image place.
i see the "function ViewArticle" code:

function ViewArticle()
{
global $txt, $context, $ID_MEMBER, $scripturl, $db_prefix, $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 = db_query("
SELECT
a.ID_ARTICLE, a.title, a.date, p.view, a.approved, a.rating, a.totalratings, m.realName, 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", __FILE__, __LINE__);
$row = mysql_fetch_assoc($dbresult);
$context['article'] = $row;
mysql_free_result($dbresult);

// Check Approval
if ($row['approved'] == 0 && $m_cats == false && $row['ID_MEMBER'] != $ID_MEMBER)
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'] != $ID_MEMBER))
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=' . $ID_MEMBER,
'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'] == $ID_MEMBER)
$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'] == $ID_MEMBER)
$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 = db_query("
SELECT
pagetext
FROM {$db_prefix}articles_page
WHERE ID_ARTICLE = $article LIMIT 1", __FILE__, __LINE__);
$row2 = mysql_fetch_assoc($dbresult);
$context['article_page'] = $row2;
mysql_free_result($dbresult);

// Display all user comments
$dbresult = 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.realName, 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", __FILE__, __LINE__);
$comment_count = db_affected_rows();
$context['article_comments'] = array();
while($row3 = mysql_fetch_assoc($dbresult))
$context['article_comments'][] = $row3;

mysql_free_result($dbresult);

$context['article_comment_count'] = $comment_count;

// Update Views
$dbresult = db_query("UPDATE {$db_prefix}articles
SET views = views + 1 WHERE ID_ARTICLE = $article LIMIT 1", __FILE__, __LINE__);

$context['page_title'] = $mbname . ' - ' . $txt['smfarticles_title'] . ' - ' . $row['title'];

$context['sub_template']  = 'viewarticle';
}


i cannot see relevant code for attachment.

vbgamer45

There is no code on the view article page for that.  On the edit article page. You have the option to insert a link to the attachment image in the article description 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

ttuu


vbgamer45

On the edit article page you have the option to attach images to the article.
To get the images to appear in the article after they are attached you can double click the image and it will be added to the article text where your cursor is at. For SMF 2.0 you have to drag and drop the image.
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

ttuu

Quote from: vbgamer45 on July 22, 2009, 02:13:40 PM
On the edit article page you have the option to attach images to the article.
To get the images to appear in the article after they are attached you can double click the image and it will be added to the article text where your cursor is at. For SMF 2.0 you have to drag and drop the image.

in the image place i see X.
in the article folder i cannot see the file.
How do I get the image to appear as part of the article?

vbgamer45

What settings do you have. Admin -> Articles Configuration -> Settings
For the Articles path and Articles url
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

ttuu


vbgamer45

That looks right. Any errors in the error log?
What do the links of the broken images look like.
Also what version of SMF
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

ttuu

Quote from: vbgamer45 on July 23, 2009, 03:02:51 PM
That looks right. Any errors in the error log?
What do the links of the broken images look like.
Also what version of SMF
ok
in log i see this errores:

http://ladaat.net/forum/index.php?action=articles;sa=editarticle2 
2: rename(/hsphere/local/home/ladaatne/ladaat.net/forum/articles/3080_24_07_09_12_50_55.jpeg_thumb,/hsphere/local/home/ladaatne/ladaat.net/forum/articles/thumb_3080_24_07_09_12_50_55.jpeg): No such file or directory
Files: /hsphere/local/home/ladaatne/ladaat.net/forum/Sources/Articles.php
Line: 883
2: getimagesize(/hsphere/local/home/ladaatne/ladaat.net/forum/articles/3080_24_07_09_12_50_55.jpeg): failed to open stream: No such file or directory
Files: /hsphere/local/home/ladaatne/ladaat.net/forum/Sources/Subs-Graphics.php
Line: 269
2: move_uploaded_file(): Unable to move '/tmp/phpwG9XJF' to '/hsphere/local/home/ladaatne/ladaat.net/forum/articles/3080_24_07_09_12_50_55.jpeg'
Files: /hsphere/local/home/ladaatne/ladaat.net/forum/Sources/Articles.php
Line: 879
2: move_uploaded_file(/hsphere/local/home/ladaatne/ladaat.net/forum/articles/3080_24_07_09_12_50_55.jpeg): failed to open stream: Permission denied
Files: /hsphere/local/home/ladaatne/ladaat.net/forum/Sources/Articles.php
Line: 879

in the edit article page the broken link is:
http://ladaat.net/forum/articles/thumb_3080_24_07_09_12_50_55.jpeg

i using SMF v.1.1.10

thanks for your help

vbgamer45

Make sure the permissions on the articles folder are writable i think either 755 or 777 will work
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

Latest verison of this mod installed on SMF 2.0 RC1.2 - member just tried a search using MemberName and got this error...

Unknown column 'memberName' in 'where clause'
File: /home2/.../public_html/forum/Sources/Articles2.php
Line: 2130

One for next release or is it something wrong with my install?

W
What type of washing machine is September?

An autumnatic. :)

vbgamer45

Will fix for next release. Should be member_name instead of MemberName 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

willerby

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

willerby

What type of washing machine is September?

An autumnatic. :)

S.Nieves

Quick question.  Can I add HTML type text here so that my google ads come up? I imported articles from Tiny portal and they all look incorrect.

Sam

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

Kindred

actually, if you have direct database access, you can put HTML directly in the article contents field...   as long as you do not edit the article in the future, it will work

(all of my imported mambo articles used html)
Сл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."

Advertisement: