1 sam2kb Jan 25, 2008 06:26
3 yabba Feb 13, 2008 18:34
you *might* be able to add your code to conf/_hacks.php ( just create the file and it's auto included ..... just not sure if it's included at the right point )
¥
4 sam2kb Feb 13, 2008 19:08
Doesn't work when I put this in _hacks.php
if ($cat_ID == 1) $posts = 4;
Do you think this is the right code, but included in the wrong place?
5 yabba Feb 13, 2008 19:23
try $cat
¥
6 sam2kb Feb 13, 2008 19:30
No luck. The simple $posts = 1; doesn't work in _hacks.php
7 yabba Feb 13, 2008 19:33
ok, that means that _hacks.php is called to late ... unfortunately /conf/_config_TEST.php is called to early so you're probably limited to hacking /inc/_blog_main.inc.php
¥
8 sam2kb Feb 13, 2008 19:56
I put the code between functions and get
Undefined variable: cat_ID
9 afwas Feb 13, 2008 20:08
global $cat_ID
10 sam2kb Feb 13, 2008 20:44
No more errors, but still doesn't work.
11 afwas Feb 13, 2008 20:53
¥åßßå wrote:
try $cat
¥
12 sam2kb Feb 13, 2008 21:11
Nothing.
Maybe I must put it inside a function.
13 sam2kb Feb 14, 2008 04:27
Thank you guys for help, but I can't get it done.
I believe it would be great to have this option in features list.
Just imagine you have 2 categories News and Products.
All posts in News are short (like a couple sentences and a link to the new product)
All posts in products are ten times longer (have full description, pictures and docs)
How many posts per page would you set in backoffice in this way? ;)
14 edb Feb 14, 2008 05:16
I'd use multiblogs and post the long stuff in a blog that only gets one post displayed and the short stuff in a blog that gets many posts displayed.
I mean, if I wanted to do something like that I'd use multiblogs for it ;)
15 sam2kb Feb 14, 2008 08:05
This is what I'm gonna do if there is no other way :(
16 yabba Feb 15, 2008 13:31
inc/_blog_main.inc.php approx 442 :
// Trigger plugin event:
// fp> TODO: please doc with example of what this can be used for
$Plugins->trigger_event( 'BeforeBlogDisplay', array('skin'=>$skin) );
switch( $cat )
{
case 1:
$posts = 1;
break;
case 2:
$posts = 10;
break;
}
¥
17 sam2kb Feb 15, 2008 14:55
Perfect!!!
We just need to add global $cat; for pages and msg form.
Thank you!
18 yabba Feb 15, 2008 16:46
no problem ;)
¥
I put this in blog1.php and it works fine, but not for 'extra path' urls .
We should better check the cat_ID, but it doesn't work like this
Any ideas?