SimplePortal
Customization => Custom Coding => Topic started by: processor 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.
$block_parameter=> array(
'images'=> 'select'
)
where are those select options ( 1) nothing, 2) category images 3)avatar images ) text strings defined, in which file?
-
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:
$txt['sp_param_sp_articles_image_options'] = 'None|Poster Avatar|Category Image';
-
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:
$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?
-
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:
$txt['sp_param_sp_articles_image_options'] = 'None|Poster Avatar|Category Image';
oh and btw
$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?
-
The following change should make it work, however I'm not sure if the result would be what you exactly want:
$row['body'] = preg_replace('~class="bbc_img~i', 'class="bbc_img sp_article', $row['body']);
$row['body'] = preg_replace('~class="bbc_img( resized)?~i', 'class="bbc_img sp_article', $row['body']);
-
oh and btw
$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:
$txt['sp_param_sp_articles_image_options'] = 'None|Poster Avatar|Category Image|Custom Item';
the select array would be the following:
0 => 'None',
1 => 'Poster Avatar',
2 => 'Category Image',
3 => 'Custom Item',
-
$txt['sp_param_sp_articles_image_options'] = 'None|Poster Avatar|Category Image|Custom Item';
the select array would be the following:
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!
-
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'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.
-
Sure, just create a new topic and I'll see if I can be of any help. ;)
-
oh and btw
$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:
$txt['sp_param_sp_articles_image_options'] = 'None|Poster Avatar|Category Image|Custom Item';
the select array would be the following:
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'] ?
-
Where is it stated, in which file, that
'images'=> 'select' block parameter is $txt['sp_param_sp_articles_image_options'] ?
-
That's in Themes/default/languages/SPortalAdmin.template.php file.