http://gingkos.net/ossn/components/Games/images/games.png
I added that to the ossn_com.php
$icon = ossn_site_url('http://gingkos.net/ossn/components/Games/images/games.png');
because the icon wasn't showing up with the directory it had that didn't exist in the addon in the first place.
Omg! Thank you so much Homelancer. You saved sooo much frustration, now I can study the notes you included, & which will teach me so much more. I have so much to learn in PHP coding... Very grateful!
> Fun Fact:
>
> You were also the 9th comment, & in numerology the number
> "9" is the number of completion. What a synchronicity!
Created a fork and fixed the component. See the comments on the pull request/source code.
I don't understand what I am doing wrong.... This is complex. I added the CSS folder, & attempted to externalize it 2 different ways, & I even tried adding the code ~
.menu-section-item-weather:before {
content: "\f185" !important;
}
to the CSS file in the new CSS folder....
I have to be close to getting it right, What am I doing wrong now? Lol.
UPDATED REPO -
Don't worry, I'm used to work in confused/confusing environments ... :)
But back to your issue: I had a look into your repository, and in fact there IS no icon css!
Thus,
Okay, There is the link. ^
EDIT: Oops I just noticed I might have confused you a bit. I was trying to add an icon to 2 other components someone else's component, & my component. I accidentally posted 2 totally different snippets of code for 2 separate components. Although the same question still applies, & is still unresolved.
Please upload your code to github.com.
This way it's much easier and transparent to others which way a problem like that can be resolved
> Yep,
>
> but besides of all that this method of displaying a menu icon is
> outdated (or at least not compatible with the current core theme)
> anyway.
>
> It would need some extra css instead. See
> https://github.com/opensource-socialnetwork/opensource-socialnetwork/blob/v4.x/themes/goblue/plugins/default/css/core/default.php
> (line 1213 and below) for examples and choose a meaningful icon for
> your component from the font-awesome pool.
Zet, Could you elaborate a bit more?
So, I have added this to the CSS
.menu-section-item-weather:before {
content: "\f185" !important;
}
but it still doesn't show?
do I have to edit the ossn_com.php in the plugin to get it to function properly. Surely I am missing something because it still isn't functioning.
This is my ossn_com.php code. ~
<?php
function weather_init() {
ossn_register_page('weather', 'weather_pages');
if (ossn_isLoggedin()) {
$icon = ossn_site_url('components/weather/image/weather.png');
ossn_register_sections_menu('newsfeed', array(
'text' => ossn_print('weather'),
'url' => ossn_site_url('weather'),
'icon' => $icon,
'section' => 'links'
));
}
}
function weather_pages($pages) {
if (!ossn_isLoggedin()) {
ossn_error_page();
}
$title = ossn_print('weather');
$contents['content'] = ossn_plugin_view('weather/weather');
$content = ossn_set_page_layout('contents', $contents);
echo ossn_view_page($title, $content);
}
ossn_register_callback('ossn', 'init', 'weather_init');
Yep,
but besides of all that this method of displaying a menu icon is outdated (or at least not compatible with the current core theme) anyway.
It would need some extra css instead. See https://github.com/opensource-socialnetwork/opensource-socialnetwork/blob/v4.x/themes/goblue/plugins/default/css/core/default.php (line 1213 and below) for examples and choose a meaningful icon for your component from the font-awesome pool.
Or
$icon = ossn_site_url("components/Games/images/games.png");
if your Ossn site URL is http://gingkos.net/ossn/
ossnsiteurl() returns your site URL like http://gingkos.net/
You only need to add the rest of the URL like:
$icon = ossn_site_url("ossn/components/Games/images/games.png");
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)