gpjens
Forum Replies Created
-
Forum: Plugins
In reply to: [xili-language] Translate Text WidgetI guess it’s simple for someone who knows how to, are able to rewrite gText Widget plugin to work with Xili Language? There are few codes in the gText plugin.
*/
class GTextWidget extends WP_Widget
{
public $gtext_enabled_langs_num; # enabled languages number
public $gtext_enabled_langs; # enabled languages @array
function GTextWidget()
{
if(function_exists(‘qtrans_init’)) {
$widget_ops = array(‘classname’ => ‘GTextWidget’, ‘description’ => __( “gText Widget”) );
$control_ops = array(‘width’ => ‘auto’, ‘height’ => ‘auto’);
$this->WP_Widget(‘gtexttext’, __(‘gText Widget’), $widget_ops, $control_ops);
$this->gtext_enabled_langs = qtrans_getSortedLanguages(); // get enabled languages
$this->gtext_enabled_langs_num = count($this->gtext_enabled_langs); // get enabled languages number
}
}
/**
* Adds qTranslate’s language delimiters to text
*/
function gtext_lang_ini($gtext_lang,$gtext_lang_content)
{
return “<!–:$gtext_lang–>$gtext_lang_content<!–:–>”;
}
function widget($args, $instance)
{
extract($args);
$text = empty($instance[‘text’]) ? ” : $instance[‘text’];
echo $before_widget;
echo $before_title . $instance[‘lang_title’] . $after_title;
echo ‘<div>’ . $instance[‘lang_text’] . “</div>”;
echo $after_widget;
}
function update($new_instance, $old_instance)
{
$instance = $old_instance;
$instance[‘lang_title’] = “”; # Clear Old Title
$instance[‘lang_text’] = “”; # Clear Old Text
foreach($this->gtext_enabled_langs as $lng) {
$instance[‘lang_title’] .= self::gtext_lang_ini($lng,$new_instance[$lng]);
}
foreach($this->gtext_enabled_langs as $lng) {
$instance[‘lang_text’] .= self::gtext_lang_ini($lng,$new_instance[‘text_’.$lng]);
}
return $instance;
}
function form($instance)
{
# check if qTranslate installed
if(!defined(“QT_SUPPORTED_WP_VERSION”)) {
echo “You Must Enable/Install Qtranslate To Use This Plugin”;
}
else
{
$instance = wp_parse_args( (array) $instance, array(‘title’=>”, ‘text’=>”) );
$title = $instance[‘title’];
$text = $instance[‘text’];
$gtext_parsed_title = qtrans_split($instance[‘lang_title’]); # parse qTranslate’s lang delimiters from title
$gtext_parsed_text = qtrans_split($instance[‘lang_text’]); # parse qTranslate’s lang delimiters from text
foreach($this->gtext_enabled_langs as $gtext_lang)
{
echo ‘<p><label for=”‘ . $this->get_field_name($gtext_lang) . ‘”>’ . __(‘Title[‘.$gtext_lang .’]’) . ‘</label>
<input style=”width:400px;margin-left:10px;” id=”‘ . $this->get_field_id($gtext_lang) . ‘” name=”‘ . $this->get_field_name($gtext_lang) . ‘” type=”text” value=”‘ . $gtext_parsed_title[$gtext_lang] . ‘” /></p>’;
echo ‘<p><label for=”‘ . $this->get_field_name(“text_”.$gtext_lang) . ‘”>’ . __(‘Text[‘.$gtext_lang.’]’) . ‘</label>
<textarea style=”width:400px;height:300px;margin-left:10px;” id=”‘ . $this->get_field_id(“text_”.$gtext_lang) . ‘” name=”‘ . $this->get_field_name(“text_”.$gtext_lang) . ‘”>’ . $gtext_parsed_text[$gtext_lang] . ‘</textarea></p>’;
}
}
}
}
function GTextInit() {
register_widget(‘GTextWidget’);
}
add_action(‘widgets_init’, ‘GTextInit’);
?>Forum: Plugins
In reply to: [xili-language] Translate Text WidgetThank you for reply! ?? But where do I get a ‘.mo file for english and norwegian? I guess I need both, in orderfor xili to switch from norwegian to english? All I have in xili folders are french *.mo and *.po files.
Forum: Fixing WordPress
In reply to: Problems with dual cssSolved!!
For some reason, I hade to add the whole adresse to the bullets in the text widget to be able to show the link-bullets when in post/news-style..
But thanks for your help guys! ??
Forum: Fixing WordPress
In reply to: Problems with dual cssI can’t seem to figure this out with Firebug… ??
Both my styles has this block for the widgets:
}
.art-BlockContent-body ul li {
font-family: Verdana, Geneva, Arial, Helvetica, Sans-Serif;
font-size: 12px;
font-style: normal;
font-weight: none;
text-decoration: none;
margin-left: 0px;
margin-right: 16px;
line-height: 150%;
line-height: 1.5em;
padding: 0px 0 0px 11px;
background-image: url(‘images/BlockContentBullets.png’);
background-repeat: no-repeat;
}Both are copy, so they are exactly the same. Why isn’t one style showing the bullets?
Bullets here: https://helgelandmuseum.no/
No bullets here: https://helgelandmuseum.no/archives/6144As mention earlyer, bullets are gone when posts are showing (using my own news-stylesheet when in posts).
Forum: Fixing WordPress
In reply to: Problems with dual cssThanx for reply! ??
Will do ?? Not sure how I use firebug, but I guess I can click elements and check if adresses and codes related to my bullets are ok… (?)
I checkd my css side-by-side, and the post and page css have exactly the same section for widgets. Page-css only has a different margin in the post-section (where post text and images are shown.. that’s why this is so frustrating.. hmf!)
Forum: Fixing WordPress
In reply to: Internet explorer.Internet explorer is not a good tool for editing wordpress. Even Microsoft says they have some problems with new codes used in example wordpress, so you should use some other explorer. Firefox i recomanded!