josjo
Forum Replies Created
-
@dozza
I think the first single.php you posted is the right one. The key I think is to change the values for$pex_page->sidebarand$pex_page->layout.The problem is I don’t know what the proper values should be and I have no way to find out since they are specific to the theme you are using.
Below is an updated version of the first single.php. This is just a wild guess so be sure to keep the original single.php if it doesn’t work.
<?php /** * Single Post Template - this is the template for the single blog post. */ get_header(); if(have_posts()){ while(have_posts()){ the_post(); //get all the page data needed and set it to an object that can be used in other files $pex_page=new stdClass(); $pex_page->subtitle=get_post_meta($post->ID, 'subtitle_value', true); $pex_page->slider='none'; if($post->post_type == 'ai1ec_event') { $pex_page->layout='left'; $pex_page->sidebar='none'; } else { $pex_page->layout=get_opt('_blog_layout'); $pex_page->sidebar=get_opt('_blog_sidebar'); } //include the before content template locate_template( array( 'includes/html-before-content.php'), true, true ); //include the post template locate_template( array( 'includes/post-template.php'), true, false ); } } //include the comments template comments_template(); //include the after content template locate_template( array( 'includes/html-after-content.php'), true, true ); get_footer(); ?>The calendar view is rendered using the page.php template. Maybe if I could see the contents of page.php I could come up with a solution.
If you know the post id you can do this on your custom page (replace [id] with your post id):
$event = Ai1ec_Events_Helper::get_event([id]);The event object has a lot of data including data for the post. You can see all data by doing this:
var_dump($event);If you want formatted versions of some of the data you can use one of the getters:
echo $event->start_time;These are the formatted properties currently available:
uid, short_start_time, short_end_time, short_start_date, short_end_date, start_time, end_time, long_start_time, long_end_time, long_start_date, long_end_date, timespan_html, post_excerpt, location, categories_html, tags_html, color_style, category_colors, contact_html, recurrence_htmlNote that this is internal to All-in-One Event Calendar and can change in the future.
If you add the code to the beginning if functions.php it must be after the initial
<?phpand if you add it to the end it must be before the ending?>(if there is one). There can also not be any whitespace or newlines after the ending?>(I’ve tried it with the Twenty Eleven theme and it works.)
Forum: Plugins
In reply to: [Plugin: All-in-One Event Calendar] Translation and localization issuesYou can ignore my rant about non ASCII characters above. I solved it by changing project settings and preferences in Poedit. I now use UTF-8 for source code charset and have changed to a custom font (DejaVu Sans Mono). Poedit doesn’t complain anymore and I can see and edit the non ASCII chars.
The issue with the text domain being loaded to late however still remains. I don’t think the fix I suggested above it will break anything else.
Forum: Plugins
In reply to: [Plugin: All-in-One Event Calendar] Translation and localization issuesThank you Yani!
I think this plugin is great. I have tested most of the popular calendar plugins for WordPress, but I found this to be the most user friendly. Plus it integrates nicely into WordPress by using custom post types.
I’ll continue translating and when I have a Swedish translation ready I’ll submit it to the project.
Keep up the good work!
Cheers,
josjoForum: Plugins
In reply to: [Plugin: All-in-One Event Calendar] Translation and localization issuesAll non ASCII (or even extended ASCII) characters like the ones below makes it hard to translate. I think it is best if these characters is not used when calling the translation functions (_e, __ and _x) if possible.
One way is to sprintf them into the strings. Maybe they should be made into constants somewhere so they are more easily replaced. Suggestions?
I also think it would benefit the translation process if all files where either UTF-8 or iso-8859-1.
Example characters: ▾ ✘
Forum: Plugins
In reply to: [Plugin: All-in-One Event Calendar] Translation and localization issuesThe text domain needs to be loaded earlier. As it is now it gets loaded after
create_post_typewhich means that the translations are not available when the menu on the admin panel is created.I tried to move it to the top of actions added to init and now it works.
Yes, there are a few translation an localization issues left. I know they are working on some of them for the next version (1.0.7). In the meantime have a look at these posts:
[Plugin: All-in-One Event Calendar] Time/Date not showing
[Plugin: All-in-One Event Calendar] Translation and localization issuesForum: Plugins
In reply to: [Plugin: All-in-One Event Calendar] Translation and localization issuesSome more information for all of you who are working on translating this plugin.
I use Poedit with the following project settings:
Charset:
UTF-8
Source code charset:
iso-8859-1
Plural forms:
nplurals=2; plural=n != 1;
Paths (assuming your translation is in the plugin’s language folder):
..\.
Keywords:
_e
__
_x:2c,1Most of the source files are in ANSI, but a few are UTF-8. If you rescan the sources with Poedit it will complain and the strings in the files with a format not matching the project settings will be marked as fuzzy.
I think you have to name the files
all-in-one-event-calendar-tr_TR.poandall-in-one-event-calendar-tr_TR.mofor the translations to be loaded.This might be a problem with PHP’s
strftimeandgmstrftimenot behaving correctly under Windows. I’ve tried to exchange those functions with the WordPress functiondate_i18nand now it works.I’m running my test server on Windows XP using XAMPP with locale set to Swedish.