xoops forums

kerkyra

Just can't stay away
Posted on: 2007/9/26 22:37
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#1

Google maps WYSIWYG editor...RSS hack

Hi i'm making an rss hack for google maps so that my visitors can see any new locations added in the map along with their descriptions. The problem is that the description part is in XOOPS code so the picture of each location is not showing. Instead it shows the [img] tag and the url.

the question

How can i implement a WYSIWYG editor in the googlemaps module so that i can add html text in the description? Anybody has any ideas?

you can see the my rss feeds at http://www.mykerkyra.gr/modules/googlemaps/rss.php (its in greek though)

if any of you need this just create an rss.php file and paste the following code in, you only need to set the charset to the one you are using...

Quote:
<?php
//
// Google Maps RSS 2.0
// displays latest point location title and description via RSS 2.0 feed.
//
// Copyright (c) 2007 Kostas Ksilas - www.mykerkyra.gr
// based on xcgal rss hack by Mowaffak Ali - www.arabxoops.com
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//
//

include_once '../../mainfile.php';


$myts =& MyTextSanitizer::getInstance();
global $myts;

$charset='iso-8859-7';
$sitename = htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES);
$email = checkEmail($xoopsConfig['adminmail'],false);
$slogan = htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES);
$module = $xoopsModule->getVar('name');
$channel_link = XOOPS_URL.'/';
$channel_desc = $slogan;
$channel_lastbuild = formatTimestamp(time(), 'rss');
$channel_editor = $email;
$channel_category = $category;
$channel_generator = $module;
$channel_language = _LANGCODE;
$link = $smarty.section.displaylastpoints.index;

// How many items you want to show in RSS feed
$upperlimit = 10;

header('Content-Type:text/xml; charset='.$charset);
$title = $sitename.' - '.$module;
$channel_title = $title;
print "<?xml version=\"1.0\" encoding=\"$charset\"?>\n";
print "<rss version=\"2.0\">";
print "<channel>\n";
print "<title>$channel_title</title>\n";
print "<link>$channel_link</link>\n";
print "<description>$channel_desc</description>";
print "<language>$channel_language</language>\n";
print "<lastBuildDate>$channel_lastbuild</lastBuildDate>\n";
print "<generator>$channel_generator</generator>\n";

$table1= $xoopsDB->prefix("gmap_points");
$table2= $xoopsDB->prefix("users");

$result=$xoopsDB->query("SELECT id,map_id,lat,lon,title,html,date FROM ".$xoopsDB->prefix("gmap_points")." ORDER BY

date DESC LIMIT 0,$upperlimit");

$path = XOOPS_URL.'/modules/googlemaps/index.php?javascript:myclick(';

while (list($id,$map_id,$lat,$lon,$title,$html,$date) = mysql_fetch_row($result)) {
print "\t<item>\n";
print "\t\t<title> $title </title>\n";
print "\t\t<link>$path$id)</link>\n";
print "\t\t<author>$channel_editor</author>\n";
print "\t\t<pubDate>$channel_lastbuild</pubDate>\n";
print "\t\t<description>";
echo $myts->htmlSpecialChars("<p>$html </p>");
print "</description>\n";
print "\t</item>\n";
print "\n";
}
print "</channel>";
print "</rss>";


still havent finished yet so if any changes i will update the code here. Hope it helps someone...
www.guidemap.gr - Beta is out...

kerkyra

Just can't stay away
Posted on: 2007/9/27 11:29
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#2

Re: Google maps WYSIWYG editor...RSS hack

anybody?
www.guidemap.gr - Beta is out...

lintu

Not too shy to talk
Posted on: 2007/9/27 11:58
lintu
lintu (Show more)
Not too shy to talk
Posts: 103
Since: 2005/9/18
#3

Re: Google maps WYSIWYG editor...RSS hack

kerkyra,

I am using Yahoo Maps APIs to publish a member community map on my web site. You can view that here.

During the member registration process, I am capturing their IP address and look up their longitude and Latitude which is then stored on the member's profile. A text file is then created with all the member info, which is used as the feed for the map.

The documentation on the Yahoo developer network was very helpful and it was pretty easy to implement. You can find all the Yahoo map how-to stuff here.

Hope this helps.
JigJak.com - A social Bookmarking & Blogging site.

ProjectMgr.net - Online Project Management Software

kerkyra

Just can't stay away
Posted on: 2007/9/27 12:13
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#4

Re: Google maps WYSIWYG editor...RSS hack

hi and thanks for the info! i'm using frappr for my community map, so i have no problem there! My main problem is how to change the default editor so as to show html code instead of XOOPS code (xoops code doesnt work with the rss i'm working on so the images are not showing). Thanks for the reply though! Very usefull indeed.
www.guidemap.gr - Beta is out...

kerkyra

Just can't stay away
Posted on: 2007/9/30 20:29
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#5

Re: Google maps WYSIWYG editor...RSS hack

Hi i made some more mods in the module!

I changed the first tab of the marker to show the title of the place, and to justify the content. I also removed the small magnifying glass image showing.

When submiting a new place i added a new Text area where the user can submit pictures (with XOOPS code) which then is showed in the second tab which is now titled "Images"!

Further more in the template instead of showing the names of the categories i added some code which shows a picture for each category and behaves as the previous text links. You only need to upload the image in the images folder of the module and name it as category_id_number.jpg.

also the image link for the rss is added. Just put an image named xml.gif in the images folder.

You can have a glimpse at http://www.mykerkyra.gr/modules/googlemaps/

Notice that a modification in the database is needed...

If someones needs something like that i'll be happy to upload the module on my server for downloading.
www.guidemap.gr - Beta is out...

Anonymous

Posted on: 2007/9/30 20:50
Anonymous
Anonymous (Show more)
Posts: 0
Since:
#6

Re: Google maps WYSIWYG editor...RSS hack

Hi kerkyra .. your site is copy of my site .. at least say thank you

Send your module and I will add WYSIWYG editors to it.

kerkyra

Just can't stay away
Posted on: 2007/9/30 23:04
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#7

Re: Google maps WYSIWYG editor...RSS hack

hey man, i never said that the design of the theme is mine!!I did made a few modifications to the theme though with the help of the community here! you can see my post here https://xoops.org/modules/newbb/viewto ... id=273341#forumpost273341

where i say that i use ramadan theme!

the theme i'm using right now is a mixture of ramadan and pro_violet!

where should i send the module?In email perhaps?

by the way i think your theme is one of the best out there (thats why i chose that one for my site)

and very easy even for newbies to understand the code and change it
www.guidemap.gr - Beta is out...

Anonymous

Posted on: 2007/9/30 23:17
Anonymous
Anonymous (Show more)
Posts: 0
Since:
#8

Re: Google maps WYSIWYG editor...RSS hack

lol kerkyra .. I'm kidding .. it's free theme.

Where I can find googlemaps module ? send URL here or via PM.

kerkyra

Just can't stay away
Posted on: 2007/9/30 23:24
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#9

Re: Google maps WYSIWYG editor...RSS hack

the one i modified can be found here

Google Maps 0.82 modified

the original one can be found here

Release of Google Maps 0.82

Appreciate the help! I really think using html instead of XOOPS code in the description would be much better and the rss would work even better!
www.guidemap.gr - Beta is out...

Anonymous

Posted on: 2007/10/1 1:13
Anonymous
Anonymous (Show more)
Posts: 0
Since:
#10

Re: Google maps WYSIWYG editor...RSS hack

Hi Kerkyra,

This is wysiwyg hack for your modified googlemaps, just ovewrite then update googlemaps module:

http://www.arabxoops.com/uploads/googlemaps_wysiwyg_hack.zip

you need to upload xoopseditor folder to class folder.