1 ltf Sep 28, 2005 14:13
3 personman Sep 30, 2005 15:28
Yes, you would want to store the $blog variable before your calendar displays, then restore it after the calendar so it doesn't mess up anything else on your sidebar. But that doesn't explain why the links in the calendar are pointing to the wrong blog. Go back to the stock calendar file, then try putting this right before your calendar include:
// Dirty trick until we get everything into objects:
$saved_blog = $blog;
$blog = 7;
And this right after:
// Restore after dirty trick:
$blog = $saved_blog;
4 ltf Sep 30, 2005 16:47
I put this in the _main.php-file:
// Dirty trick until we get everything into objects:
$saved_blog = $blog;
$blog = 7;
require( dirname(__FILE__).'/_calendar.php' );
// Restore after dirty trick:
$blog = $saved_blog;
But still have the same behavior as in the first post. Calendar shows, links don't work.
I figure that there must be some other variable that is used for putting the links together, put I didn't find it and thus can't do another "dirty trick".
5 personman Sep 30, 2005 17:14
/skins/yourskin/_main.php calls
/skins/yourskin/_calendar.php, which calls
/skins/_calendar.php, which gets all it's functions from
/b2evocore/_class_calendar.php, which builds the links using
archive_link(), a function that is defined in
/b2evocore/_functions_template.php
The archive_link() funtion has $file as one of it's parameters. That's where the first part of the url will come from. I don't know how to change the behavior, but those are the files you'll have to work with. For some reason, when you change $blog to 7 up in _main.php, it's not making it all the way to the archive_link() function.
6 yabba Sep 30, 2005 17:50
$save_Blog=$Blog;
$save_blog = $blog;
$Blog = Blog_get_by_ID(3);
$blog = 3;
require( dirname(__FILE__).'/_calendar.php' );
$Blog = $save_Blog;
$blog = $save_blog;
¥
7 ltf Oct 02, 2005 12:02
thanks a lot, that did it.
Maybe providing the links to my blog will help...
The standard-blog (blog#1 in previous post) can be found at:
http://lars.wahnmache.de/blogs/index.php/polit
The events-blog (blog#2) can be found at:
http://lars.wahnmache.de/blogs/index.php/termine/
Right now I changed everything back, but all I did so far was to include the calendar in the sidebar and change the variable in _calendar.php ("7" instead of "$blog")
I fooled around with the files that might be related to the calendar-function quite a bit, but since I'm not a coder, I still don't understand what's going on and I'm not sure which files are relevant. I looked at these:
While fooling around I also took a look at the /skins/ _linkblog.php file. I found this in there:
and at the end of the file:
I think this changes the $blog-variable for the time it takes to generate the linkblog (which is a separate blog just like my events-blog) and then changes it back so the rest of the page is generated normally. If this is correct, could I do something similar?
In the case I just demonstrated my complete ignorance concerning php I hope you had a good laugh. Thanks for reading.