collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 521
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Author Topic: A Better "SMF ARTICLES" Block  (Read 40070 times)

0 Members and 2 Guests are viewing this topic.

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: A Better "SMF ARTICLES" Block
« Reply #20 on: May 10, 2009, 11:15:55 PM »
Ok, I think I know what the problem is:

in line 238 of your Subs.php says:
Code: [Select]
function db_query($db_string, $file, $line)
Well, I'm a SMF 2.0 User not and 1.1.x so I didn't knew what was happening. I searched a bit and found that SMF 1.1.x needs arguments for $file and $line.

In other words, it needs this when we do a query:
Code: [Select]
__FILE__, __LINE__
eheh :P

So, try this in a php block and see if it works ;)
Code: [Select]
global $scripturl, $db_prefix;
isAllowedTo('view_articles');
$dbresult = db_query("
SELECT a.ID_ARTICLE, a.title, a.commenttotal
FROM {$db_prefix}articles AS a
WHERE a.approved = 1
ORDER BY a.date DESC
LIMIT 8", __FILE__, __LINE__);

echo'
<table>';
while ($row = mysql_fetch_assoc($dbresult))
{
echo '
<tr>
<td align="center" style="padding:6px;">', sp_embed_image('topic'), ' </td>
<td><span class="smalltext"><a href="' . $scripturl . '?action=articles;sa=view;article=' . $row['ID_ARTICLE'] . '">' . $row['title'] . '  (' . $row['commenttotal'] . ')</a></span></td>
</tr>';
}
mysql_free_result($dbresult);

echo'
</table>
<hr>
', sp_embed_image('dot'), ' <span class="smalltext"><font color="#000000"><b><a href="' . $scripturl . '?action=articles">Read ALL Reviews</a></b></span>';
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

techprince

  • Guest
Re: A Better "SMF ARTICLES" Block
« Reply #21 on: May 11, 2009, 01:58:23 PM »
Working fine :) and i also found out the same last day :)

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: A Better "SMF ARTICLES" Block
« Reply #22 on: May 11, 2009, 02:05:06 PM »
Glad I helped you :P
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

techprince

  • Guest
Re: A Better "SMF ARTICLES" Block
« Reply #23 on: May 11, 2009, 02:15:59 PM »
There is no Karma system enabled here or else i would have repped you :) Thanks for everything :D

And yes, here is the XHTML Transitional Valid Code for Latest Articles :)

Code: [Select]
global $scripturl, $db_prefix;
isAllowedTo('view_articles');
$dbresult = db_query("
SELECT a.ID_ARTICLE, a.title, a.commenttotal
FROM {$db_prefix}articles AS a
WHERE a.approved = 1
ORDER BY a.date DESC
LIMIT 8", __FILE__, __LINE__);

echo'
<table>';
while ($row = mysql_fetch_assoc($dbresult))
{
echo '
<tr>
<td style="text-align:center;padding:6px;">', sp_embed_image('topic'), ' </td>
<td><span class="smalltext"><a href="' . $scripturl . '?action=articles;sa=view;article=' . $row['ID_ARTICLE'] . '">' . $row['title'] . '  (' . $row['commenttotal'] . ')</a></span></td>
</tr>';
}
mysql_free_result($dbresult);

echo'
</table><hr />
', sp_embed_image('dot'), ' <span class="smalltext"><i><b><a href="' . $scripturl . '?action=articles">Read ALL Reviews</a></b></i></span>';
« Last Edit: May 11, 2009, 02:22:39 PM by techprince »

Offline Daydreamer

  • Jr. Member
  • **
  • Posts: 59
  • Gender: Male
  • ЯocKayseri
    • mnyk
  • SMF Version: 2 RC1
  • SP Version: 2.2
Re: A Better "SMF ARTICLES" Block
« Reply #24 on: June 02, 2009, 07:20:03 PM »
I used this style.. This code should work on 2.0.
Code: [Select]
function makale()
{
global $smcFunc, $scripturl;
isAllowedTo('view_articles');
$dbresult = $smcFunc['db_query']('', "
SELECT a.ID_ARTICLE, a.title, a.description, a.ID_CAT, imageurl
FROM {db_prefix}articles AS a
LEFT JOIN {db_prefix}articles_cat AS c ON (a.ID_CAT = c.ID_CAT)
WHERE a.approved = 1
ORDER BY a.date DESC
LIMIT 6
");
echo'<div class="clearfloat" id="article">';
while ($row = $smcFunc['db_fetch_assoc']($dbresult))
{
echo '
<div class="clearfloat" style="border-bottom:1px solid #111111;">
<a href="' . $scripturl . '?action=articles;sa=view;article=' . $row['ID_ARTICLE'] . '">
   <img src="' . $row['imageurl'] . '" alt="',$item['title'],'"  class="left" />
   </a>
   <div class="info"><a href="' . $scripturl . '?action=articles;sa=view;article=' . $row['ID_ARTICLE'] . '" class="title">',shorten_subject($row['title'], 50),'</a><br />
  <div class="meta" style="font-size:10px;">',shorten_subject($row['description'], 100), '</div>
</div></div>
';
}
echo'</div>';
$smcFunc['db_free_result']($dbresult);
}
makale();
This style code requires..
Code: [Select]
#article .info {
padding:5px 0;
width:190px;
}
#article .clearfloat {
margin-bottom:8px;
margin-top:7px;
display:block;
}
#article a img {
margin-right:10px;
margin-top:2px;
padding:5px 0;
}
.left, .alignleft {
float:left;
}
Seems like in attachment

Offline primetime

  • Semi Newbie
  • *
  • Posts: 8
  • SMF Version: 2 RC1
  • SP Version: 2.2.2
Re: A Better "SMF ARTICLES" Block
« Reply #25 on: August 04, 2009, 11:05:15 PM »
problem solved
« Last Edit: August 05, 2009, 11:43:30 AM by primetime »

Offline kcmartz

  • Semi Newbie
  • *
  • Posts: 39
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: A Better "SMF ARTICLES" Block
« Reply #26 on: April 18, 2010, 07:38:20 PM »
Does this work for SMF 2.0RC3?

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: A Better "SMF ARTICLES" Block
« Reply #27 on: April 19, 2010, 03:02:25 AM »
Does this work for SMF 2.0RC3?

Well, despite the fact that SMF Articles hasn't been updated yet. That block code works fine.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline haito

  • Semi Newbie
  • *
  • Posts: 46
  • Gender: Male
  • maybe lucky
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: A Better "SMF ARTICLES" Block
« Reply #28 on: July 14, 2010, 12:10:56 AM »
I used this style.. This code should work on 2.0.
Code: [Select]
function makale()
{
global $smcFunc, $scripturl;
isAllowedTo('view_articles');
$dbresult = $smcFunc['db_query']('', "
SELECT a.ID_ARTICLE, a.title, a.description, a.ID_CAT, imageurl
FROM {db_prefix}articles AS a
LEFT JOIN {db_prefix}articles_cat AS c ON (a.ID_CAT = c.ID_CAT)
WHERE a.approved = 1
ORDER BY a.date DESC
LIMIT 6
");
echo'<div class="clearfloat" id="article">';
while ($row = $smcFunc['db_fetch_assoc']($dbresult))
{
echo '
<div class="clearfloat" style="border-bottom:1px solid #111111;">
<a href="' . $scripturl . '?action=articles;sa=view;article=' . $row['ID_ARTICLE'] . '">
   <img src="' . $row['imageurl'] . '" alt="',$item['title'],'"  class="left" />
   </a>
   <div class="info"><a href="' . $scripturl . '?action=articles;sa=view;article=' . $row['ID_ARTICLE'] . '" class="title">',shorten_subject($row['title'], 50),'</a><br />
  <div class="meta" style="font-size:10px;">',shorten_subject($row['description'], 100), '</div>
</div></div>
';
}
echo'</div>';
$smcFunc['db_free_result']($dbresult);
}
makale();
This style code requires..
Code: [Select]
#article .info {
padding:5px 0;
width:190px;
}
#article .clearfloat {
margin-bottom:8px;
margin-top:7px;
display:block;
}
#article a img {
margin-right:10px;
margin-top:2px;
padding:5px 0;
}
.left, .alignleft {
float:left;
}
Seems like in attachment
it doesnt work anymore :'(
update please
- brrr

Offline haito

  • Semi Newbie
  • *
  • Posts: 46
  • Gender: Male
  • maybe lucky
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: A Better "SMF ARTICLES" Block
« Reply #29 on: July 17, 2010, 12:06:07 AM »
anyone? :(
- brrr

Offline haito

  • Semi Newbie
  • *
  • Posts: 46
  • Gender: Male
  • maybe lucky
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: A Better "SMF ARTICLES" Block
« Reply #30 on: August 01, 2010, 05:41:06 AM »
bump. update please  :(
- brrr

Offline excaliburj

  • Semi Newbie
  • *
  • Posts: 18
Re: A Better "SMF ARTICLES" Block
« Reply #31 on: August 02, 2010, 01:42:06 PM »
Not sure about the styling, but this code should pull up the article info:

Code: [Select]
global $smcFunc, $scripturl;
isAllowedTo('view_articles');
$dbresult = $smcFunc['db_query']('', "
SELECT a.ID_ARTICLE, a.title, a.description, a.ID_CAT, imageurl
FROM {db_prefix}articles AS a
LEFT JOIN {db_prefix}articles_cat AS c ON (a.ID_CAT = c.ID_CAT)
WHERE a.approved = 1
ORDER BY a.date DESC
LIMIT 6", array());

echo'<div class="clearfloat" id="article">';
while ($row = $smcFunc['db_fetch_assoc']($dbresult))
{
echo '
<div class="clearfloat" style="border-bottom:1px solid #111111;">
<a href="' . $scripturl . '?action=articles;sa=view;article=' . $row['ID_ARTICLE'] . '">
   <img src="' . $row['imageurl'] . '" alt="',$item['title'],'"  class="left" />
   </a>
   <div class="info"><a href="' . $scripturl . '?action=articles;sa=view;article=' . $row['ID_ARTICLE'] . '" class="title">',shorten_subject($row['title'], 50),'</a><br />
  <div class="meta" style="font-size:10px;">',shorten_subject($row['description'], 100), '</div>
      </div></div>
';
}
echo'</div>';
$smcFunc['db_free_result']($dbresult);

Offline Morph

  • Semi Newbie
  • *
  • Posts: 14
  • Gender: Male
  • AngelinaBelle Fan!
    • NKGCommunity
  • SMF Version: 1.1.12
  • SP Version: 2.3.3
Re: A Better "SMF ARTICLES" Block
« Reply #32 on: November 19, 2010, 06:37:39 AM »
i'm sorry for the question, i don't understand well, maybe the language.
Where can i put that code? i try to add a php block with this code on my sp 2.3.1, but i obtain this error:

Code: [Select]
Table 'Sql215428_4.smf_articles' doesn't exist
File: /web/htdocs/www.nkgcommunity.it/home/forumb/Sources/PortalBlocks.php(3461) : eval()'d code
Linea: 8

I naturally use simple portal articles...

Many thanks

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: A Better "SMF ARTICLES" Block
« Reply #33 on: November 19, 2010, 08:20:06 AM »
This block is intended to work with the SMF ARTICLES mod.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Morph

  • Semi Newbie
  • *
  • Posts: 14
  • Gender: Male
  • AngelinaBelle Fan!
    • NKGCommunity
  • SMF Version: 1.1.12
  • SP Version: 2.3.3
Re: A Better "SMF ARTICLES" Block
« Reply #34 on: November 19, 2010, 09:45:30 AM »
oh, so, i have to install this mod:
http://custom.simplemachines.org/mods/index.php?mod=1354
and then i must add a php block with the code that i can find in this topic.
Is it correct?
Thank you again!

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: A Better "SMF ARTICLES" Block
« Reply #35 on: November 19, 2010, 11:05:40 AM »
I think that is the general idea.
 
It is also possible to simply use the SimplePortal articles system, and use a SimplePortal articles block.  Please give it a try and see if it does what you need it to do.  I think the idea of SMF ARTICLES is a bit more akin to SimplePortal pages. But not exactly.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline fdr77

  • Jr. Member
  • **
  • Posts: 60
  • Gender: Male
  • Non può piovere per sempre
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: A Better "SMF ARTICLES" Block
« Reply #36 on: December 10, 2010, 09:09:19 PM »
in which file,  enter the code css?
E' meglio bruciarsi in fretta che spegnersi lentamente                                               Kurt D. Cobain

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: A Better "SMF ARTICLES" Block
« Reply #37 on: December 12, 2010, 10:50:14 PM »
portal.css might be a good place to add CSS for blocks.
This block works with SMF ARTICLES mod.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline barbar

  • Semi Newbie
  • *
  • Posts: 22
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: A Better "SMF ARTICLES" Block
« Reply #38 on: January 17, 2011, 05:09:17 PM »
how can i set the limit for number of characters per article and also display the embeded video? i dont use my forums so i cant use simple articles

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: A Better "SMF ARTICLES" Block
« Reply #39 on: January 17, 2011, 05:16:28 PM »
Articles are just certain designated topic posts from your forum.
You can use the [cutoff] tag instead of character limit.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?