Support Forums

Getting Magpie working

This is a discussion on Getting Magpie working within the Technical Support forums, part of the Technical Support Forums category; Currently using v4.1.3 Designer. I would like to get Magpie up and running so that we can display feeds from ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 07-15-2009, 07:11 AM   #1
Customer
 
Join Date: Jun 2009
Location: Oxford, UK
Posts: 47
Rep Power: 9
mark is on a distinguished road
Default Getting Magpie working

Currently using v4.1.3 Designer.

I would like to get Magpie up and running so that we can display feeds from another affiliate site.

Guessing that I cannot directly edit the index.php file with code to generate the feed as only using designer version.
Question is, how can I start using Magpie?
I have searched forums and docs but cannot get started on this one, any help would be greatly appreciated.

Mark
mark is offline  
Old 07-15-2009, 08:12 AM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,410
Rep Power: 137
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Write a smarty plugin in php that reads the magpie feed and turn it into html then simply add the plugin line to the template where you want it displayed.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 07-22-2009, 11:32 AM   #3
Customer
 
Join Date: Jun 2009
Location: Oxford, UK
Posts: 47
Rep Power: 9
mark is on a distinguished road
Default

Thanks Larry for the reply.
Have been busy on the other thousand items in my to do list.

I am not too bad with scipting and programming (not in Smarty or PHP yet) but I just need that leg up to the first rung with 68 Classified implementation.

So that you understand where I am comming from:
I am adding a new page (via page editor) so that I can display an XML feed from a UK based traffic service. I am guessing that using Magpie would be an easy way of achieving this. Though I do not have a problem creating my own simple parser.

OK, so getting to the first rung - Can anyone very simply demonstrate how to create a PHP script to just display some text, use a smarty plugin to display, in HTML on my page, the text.

I think once I have done this I can use reference, manuals and the forum to proceed into the more complicated scripting.

Thanks in advance

FYI, we have now upgraded to the Developer version.
mark is offline  
Old 07-22-2009, 11:37 AM   #4
curmudgeon
 
Join Date: Mar 2006
Posts: 5,410
Rep Power: 137
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

For starters anything you put in a 68C page via the "extra pages" functionality will be stored in the database and thus willnot be parsed by the web server. This means if you place php code on a page it will not be parsed, it will just be displayed as you entered it.

php script to display text.....

PHP Code:
<?php
echo "This text will be displayed on the web page";
?>
A smarty plugin is just a php scipt located in a specific folder and referenced in a smarty template via its name.

There are countless php and smarty tutorials on the web to get you started no sense recreating the wheel here.

There ar also likely dozens if not hundreds of php code snippets for magpie parsing that you can look at and incorporate into your plugin.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 07-23-2009, 06:25 AM   #5
Customer
 
Join Date: Jun 2009
Location: Oxford, UK
Posts: 47
Rep Power: 9
mark is on a distinguished road
Default

Larry

Now that simple answer explained a few issues. Was getting rather frustrated that these pages were not doing anything.

The page I am attempting to create is just an information page giving weather and traffic from a feed. The traffic feed being searchable by area.

So, to create a page that is parsed by the web server can I create and upload to web sever and create a link to this page from a menu - Or will this not be parsed as well?
If so, any hints on how I can create a parsed information page outside of the normal view, show, browse templates.

Tried to get an answer back yesterday but I am having big problems posting in this forum. Seems as though I have to log in four or five times and this morning had to clear all cookies and tmp files before I could reply to post. Most annoying.

Cheers

Mark
mark is offline  
Old 07-23-2009, 06:50 AM   #6
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,315
Rep Power: 82
seymourjames is a jewel in the rough
Default

The way I would do it is to cheat - this should work. Take a template file like home.tpl. Copy it and call it mypage.tpl and then take index.php and make a copy. Call it mypage.php . Then in mypage.php, make sure it calls mypage.tpl in the assignment near the bottom. You can then start to put your code into mypage.tpl . Remove the call to the content as you are putting your own code in. The index.php file contains a few things you actually do not need but that will not bother you.

You then link to mypage.php from wherever you like.

There are actually many ways you can do this. I would just do this one as it came into my mind first.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline  
Old 07-23-2009, 07:17 AM   #7
Customer
 
Join Date: Jun 2009
Location: Oxford, UK
Posts: 47
Rep Power: 9
mark is on a distinguished road
Default

Seymourjames

Thanks for the hint
This cheat should also allow to keep the layout the same as the rest of the site. If I can get this working I have other areas I can use it for.
I will give this go today and let you know.

Cheers

Mark
mark is offline  
Old 07-23-2009, 08:14 AM   #8
Customer
 
Join Date: Jun 2009
Location: Oxford, UK
Posts: 47
Rep Power: 9
mark is on a distinguished road
Default

OK, cannot put PHP code into the tpl file, this is not parsed.
Do I have to do all the PHP in the MyPage.php and then pass to MyPage.tpl for display?

Mark
mark is offline  
Old 07-23-2009, 08:25 AM   #9
curmudgeon
 
Join Date: Mar 2006
Posts: 5,410
Rep Power: 137
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by mark
OK, cannot put PHP code into the tpl file, this is not parsed.
Do I have to do all the PHP in the MyPage.php and then pass to MyPage.tpl for display?

Mark
Yes you can if you follow the rules.

Smarty
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 07-23-2009, 08:47 AM   #10
Customer
 
Join Date: Jun 2009
Location: Oxford, UK
Posts: 47
Rep Power: 9
mark is on a distinguished road
Default

Muchas Gracias

Got something to display

That is my first rung reached. Sorry for being a bit amateurish to start, hopefully in time I'll also be able to help others.

Any other hints in this direction would always be welcome. Bit suprised that others don't break out of the mould.

Mark (much more pleased today)
mark is offline  
Closed Thread

Tags
magpie , reed , rss , xml

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Captcha not working shaggy Technical Support 3 03-29-2009 04:01 PM
Captcha not working skekum Technical Support 2 03-07-2009 09:52 AM
Filter RSS feed with magpie bowers01 Technical Support 6 11-15-2008 11:36 AM


All times are GMT -4. The time now is 03:19 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0