1 chuang21 Mar 13, 2008 00:02
3 chuang21 Mar 13, 2008 17:04
Wow thanks a lot EdB for your quick response!!!
Unfortunately if you make the change:
display_if_empty( 'If there were any posts here you would see them' );
you get the error:
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\wamp\www\nonstable\b2evolution\blogs\inc\_core\ui\results\_results.class.php on line 1963
I found a work around thou, by just adding to the "Sorry, there is nothing to display..." message.
if(display_if_empty())
{
echo 'More to come in the next 2 weeks...';
}
This works fine for me...
Thanks Again!! Really appreciate it!
4 yabba Mar 13, 2008 17:19
display_if_empty( array( 'msg_empty' => 'urm, we appear to be empty' ) );
¥
5 chuang21 Mar 13, 2008 17:26
THANKS!!! ¥åßßå
Worked Great!!!
6 edb Mar 14, 2008 00:38
Wow that's crazy. Old way = MUCH better, but such is life.
Thanks ¥
7 yabba Mar 14, 2008 01:02
New way == MUCH more flexible as it allows for all sorts of unseen future advances ........ confusing as hell when it doesn't come with a manual huh .... guess that's 1 - 0 to the old way :p
¥
8 fredsy Sep 06, 2008 17:03
Is there any way to include a call to a skin file in the display_if_empty code? I want to add a long (long) message instead of the 'sorry, nothing to show' bit, and would prefer calling a file...
9 yabba Sep 06, 2008 18:18
<?php
$my_stuff = implode( '', file( dirname(__FILE__).'/my_file_in_skins_sub_dir.php' ) );
display_if_empty( array( 'msg_empty' => $my_stuff ) );
?>
ish
¥
10 fredsy Sep 06, 2008 18:54
Hmm... it's giving me this error:
Parse error: syntax error, unexpected T_STRING, expecting ')' in /public_html/skins/myskin/single.main.php on line 54
I'm using 2.4.2 by the way.
11 yabba Sep 07, 2008 09:52
I'm gonna guess that line 54 is <?php in which case remove the <?php and ?> from the above snippet ;)
Also, remeber to change => to the actual charcters =>
¥
12 fredsy Sep 07, 2008 11:23
Thanks Yabba, it works now. I tried removing the <?php before but must have missed a character.
The file depends on your version and your skin. Assuming 240-RC2 and custom skin, try in index.main.php finding
and replacing it with
I'm pretty sure that'll work. Generally I think of that as the empty blog message, but it might also be what gets shown when a category (or any other filtered criteria) returns no results.