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: 194
  • 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: Customizing Articles Block  (Read 10968 times)

0 Members and 1 Guest are viewing this topic.

Offline processor

  • Semi Newbie
  • *
  • Posts: 24
  • SMF Version: 2.0.6
  • SP Version: 2.3.5
Customizing Articles Block
« on: January 10, 2014, 12:56:28 PM »
I am wondering where are select options for article portal block defined, in which files i mean? i've been looking like crazy, can't find it.

Code: [Select]
$block_parameter=> array(
                'images'=> 'select'
)

where are those select options ( 1) nothing, 2) category images 3)avatar images ) text strings defined, in which file?

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Customizing Articles Block
« Reply #1 on: January 10, 2014, 01:21:05 PM »
Hello and welcome to SimplePortal!

All language strings are defined in language files found in Themes/default/languages directory. Those particular strings are in SPortalAdmin.english.php file, the following line:

Code: [Select]
$txt['sp_param_sp_articles_image_options'] = 'None|Poster Avatar|Category Image';
And slowly, you come to realize... It's all as it should be...

Offline processor

  • Semi Newbie
  • *
  • Posts: 24
  • SMF Version: 2.0.6
  • SP Version: 2.3.5
Re: Customizing Articles Block
« Reply #2 on: January 10, 2014, 02:33:04 PM »
Hello and welcome to SimplePortal!

All language strings are defined in language files found in Themes/default/languages directory. Those particular strings are in SPortalAdmin.english.php file, the following line:

Code: [Select]
$txt['sp_param_sp_articles_image_options'] = 'None|Poster Avatar|Category Image';

I have no idea how i missed it, i thought i searched all portal language files for that. Well thanks a bunch Sinan :) and thanks for welcome, love the portal!

I just had to readjust it to look more like a news portal rather than blog style so i customized your already built in article block to display articles as they are displayed by default in article.template.php rather than the prior post link + avatar + category image layout.
So now my article blocks nicely show article excerpts with text nicely sorted by categories where and how i want it.



Let me ask you one more thing. I use sp-s image resize, but, if smf setting to resize images is set then simpleportals image resize isn't working. I guess he just looks for the [img] bbc, but if the tag has width setting due to smf resize, then simple portal doesn't recognizes it. Also the whole resize is a bit meh because then you have to load all the pictures. I guess best solution would be to code articles to recognize first images in post and create a thumbnail to be displayed in article blocks and default display. Anyway, is there any solution for sp not recognizing img bbc if it has width/height resize from smf already?
« Last Edit: January 10, 2014, 02:37:54 PM by processor »

Offline processor

  • Semi Newbie
  • *
  • Posts: 24
  • SMF Version: 2.0.6
  • SP Version: 2.3.5
Re: Customizing Articles Block
« Reply #3 on: January 10, 2014, 02:43:57 PM »
Hello and welcome to SimplePortal!

All language strings are defined in language files found in Themes/default/languages directory. Those particular strings are in SPortalAdmin.english.php file, the following line:

Code: [Select]
$txt['sp_param_sp_articles_image_options'] = 'None|Poster Avatar|Category Image';

oh and btw

Code: [Select]
$block_parameter=> array(
                'images'=> 'select'
)

I see where the text strings are now. But where is the select array defined with it's keys etc?

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Customizing Articles Block
« Reply #4 on: January 10, 2014, 02:44:53 PM »
The following change should make it work, however I'm not sure if the result would be what you exactly want:

Code: (Find) [Select]
$row['body'] = preg_replace('~class="bbc_img~i', 'class="bbc_img sp_article', $row['body']);
Code: (Replace) [Select]
$row['body'] = preg_replace('~class="bbc_img( resized)?~i', 'class="bbc_img sp_article', $row['body']);
And slowly, you come to realize... It's all as it should be...

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Customizing Articles Block
« Reply #5 on: January 10, 2014, 02:48:05 PM »
oh and btw

Code: [Select]
$block_parameter=> array(
                'images'=> 'select'
)

I see where the text strings are now. But where is the select array defined with it's keys etc?

We just explode the text string. So if you had the following text string:

Code: [Select]
$txt['sp_param_sp_articles_image_options'] = 'None|Poster Avatar|Category Image|Custom Item';
the select array would be the following:

Code: [Select]
0 => 'None',
1 => 'Poster Avatar',
2 => 'Category Image',
3 => 'Custom Item',
And slowly, you come to realize... It's all as it should be...

Offline processor

  • Semi Newbie
  • *
  • Posts: 24
  • SMF Version: 2.0.6
  • SP Version: 2.3.5
Re: Customizing Articles Block
« Reply #6 on: January 10, 2014, 02:50:25 PM »
Code: [Select]
$txt['sp_param_sp_articles_image_options'] = 'None|Poster Avatar|Category Image|Custom Item';
the select array would be the following:

Code: [Select]
0 => 'None',
1 => 'Poster Avatar',
2 => 'Category Image',
3 => 'Custom Item',

Ah genius. You helped me a lot, and i like the logic behind smf and sp. Both are great products!

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Customizing Articles Block
« Reply #7 on: January 10, 2014, 03:03:54 PM »
I've learned everything I know from reading SMF code, so they are pretty much alike; "simple" with one word.

So anything else I can help with?
And slowly, you come to realize... It's all as it should be...

Offline processor

  • Semi Newbie
  • *
  • Posts: 24
  • SMF Version: 2.0.6
  • SP Version: 2.3.5
Re: Customizing Articles Block
« Reply #8 on: January 10, 2014, 03:27:19 PM »
I've learned everything I know from reading SMF code, so they are pretty much alike; "simple" with one word.

So anything else I can help with?

I think there's going to be few more things but as time goes i'll ask, this all solved what was bugging me. Yeah i'm in process of learning source code of both, it's going well.

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Customizing Articles Block
« Reply #9 on: January 10, 2014, 03:29:25 PM »
Sure, just create a new topic and I'll see if I can be of any help. ;)
And slowly, you come to realize... It's all as it should be...

Offline processor

  • Semi Newbie
  • *
  • Posts: 24
  • SMF Version: 2.0.6
  • SP Version: 2.3.5
Re: Customizing Articles Block
« Reply #10 on: January 30, 2014, 09:43:52 AM »
oh and btw

Code: [Select]
$block_parameter=> array(
                'images'=> 'select'
)

I see where the text strings are now. But where is the select array defined with it's keys etc?


We just explode the text string. So if you had the following text string:

Code: [Select]
$txt['sp_param_sp_articles_image_options'] = 'None|Poster Avatar|Category Image|Custom Item';
the select array would be the following:

Code: [Select]
0 => 'None',
1 => 'Poster Avatar',
2 => 'Category Image',
3 => 'Custom Item',

Where is it stated, in which file, that

  'images'=> 'select' block parameter is $txt['sp_param_sp_articles_image_options'] ?

Offline processor

  • Semi Newbie
  • *
  • Posts: 24
  • SMF Version: 2.0.6
  • SP Version: 2.3.5
Re: Customizing Articles Block
« Reply #11 on: February 14, 2014, 04:39:00 AM »
Where is it stated, in which file, that

  'images'=> 'select' block parameter is $txt['sp_param_sp_articles_image_options'] ?

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Customizing Articles Block
« Reply #12 on: February 17, 2014, 05:19:38 AM »
That's in Themes/default/languages/SPortalAdmin.template.php file.
And slowly, you come to realize... It's all as it should be...