How to use the same style for sitemap as of forum.

The GYM Sitemaps & RSS module for phpBB. Sitemaps and RSS feeds for Google Yahoo! and MSN Live, support, add ons etc ...

Moderator: Moderators

How to use the same style for sitemap as of forum.

Postby digital1 » Sat Jul 19, 2008 6:22 pm

Hello ,

I want to use the default style of my forum and portal in RSS and Sitemap pages. That is i want to use the same overall_footer.html and over overall_header.html in style of RSS and sitemap.
The one which comes default in the package looks odd as i have heavly modded these file to give a better look to the website.

Is it possible????
digital1
PR0
PR0
 
Posts: 54
Joined: Fri Oct 26, 2007 6:53 am
Location: India

Advertisement

Postby admintiger » Sat Jul 19, 2008 9:10 pm

I have related questions.

I created my own phpbb3 board style based on prosilver and set it to be the board default style. It is similar to prosilver, but with different colors and with certain other things changed. I am not concerned about being about to use my board header and footer for RSS and Sitemap pages, but I would like to have the page colors match.

I understand that Sitemap page styling is determined by gym_google.css and gym_google.xls transforms and that RSS page styling is determined by gym_rss.css and gym_rss.xls transforms. However, those files are generated automatically and it doesn't seem that the intention is that they be manually modified.

Regardless of whether I set "Load phpBB CSS" to Yes or No with "XSLT Styling" set to Yes, after clearing the RSS cache in the "Maintenance" menu, RSS and Sitemap pages still have prosilver colors.

1) Is it possible to use colors from a style other than prosilver?

2) If not, is it possible to set colors manually in a GYM CSS file?

It appears that one workaround would be to change prosilver colors to match the colors used in my custom style, but I prefer to leave prosilver unmodified.

-Bob
admintiger
 
Posts: 16
Joined: Thu May 29, 2008 11:32 pm

Postby jonli447 » Sun Jul 20, 2008 1:05 am

You have to edit gym_google.xsl and gym_rss.xsl in your style's template folder, i.e. "prosilver/template/".
jonli447
 
Posts: 17
Joined: Wed Oct 31, 2007 11:15 pm

Postby digital1 » Sun Jul 20, 2008 11:57 am

Hello, i edit the files you mentioned but there is no sign of changes any where in sitemap index.

I am still trying to figure out how to customize the style.
digital1
PR0
PR0
 
Posts: 54
Joined: Fri Oct 26, 2007 6:53 am
Location: India

Postby dcz » Sun Jul 20, 2008 1:18 pm

So first, we only provided the prosilver xsl templates so far, so it will be easier for prosilver based theme.

Then, the principle.

The files involved for the layout are gym_google.xsl, gym_rss.xsl and gym_js.js. They are both in the gym_sitemaps/style/ and the style/prosilver/template/ dirs.
These files goes with css file, gym_google.css and gym_rss.css, located both in gym_sitemaps/style/ and the style/prosilver/theme/ dirs.

These are indeed templates, like phpBB templates and css, they need to be parsed to be used in the display, which is done by the gym_sitemaps/gym_style.php file kind of like the way the phpBB style.php file will do, but both for css and xsl and without the need to connect to the db each time, if the file is cached, it will be sent as is directly.

The xsl and css cached files goes in gym_sitemaps/cache/.

So talking about admintiger's case, a theme based on prosilver, try to copy the css, js and xsl files in the corresponding dirs of your theme. Then, go ACP and activate the use of phpBB's css, go to the maintenance menu and clear the outptu cache).
The xsl prosilver template should be now displayed with your theme's css, thus colors and background imgages.

If you change the html layout in the templates, you may need to do similar changes in the xsl files, but chances are great that it will work nicely directly on the xhtml code.

You could as well not load the phpBB's css and mod the gym css files to match your theme, but I think that's it's easier to eventually do few changes in the xsl file than to re do the whole css.

Then, if you want to do the same thing with a theme based on subsilver2 or totally different, the principle is the same, but you'll most likely need to implement more change in the xsl files to match your theme html code and css class names better.

With time, we'l provide with more theme's xsl files, css are less important, since you can use the phpBB one directly. With a supported theme like prosilver it's very cool, all your personalisations gets taken into account directly in the sitemaps and rss feeds as long as you use the phpbb's css (one click in acp) :D

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby admintiger » Sun Jul 20, 2008 1:52 pm

Thanks for your prompt and thorough explanations. I realized most of this with a little more study of the files after I had asked my questions, but it is reassuring to have your explanation.

I don't know how you manage to provide such excellent technical support while also developing software. You're amazing!

-Bob
admintiger
 
Posts: 16
Joined: Thu May 29, 2008 11:32 pm

Postby dcz » Sun Jul 20, 2008 2:43 pm

I write fast (too fast if you consider the amount of typos in my posts :roll: ) and U have four hands :lol:

No seriously, I'm not alone to do all the job here, GYM Sitemaps & RSS would not have been this nice without all the team efforts ;)

So, was the phpBB css enough or did you have to change the xsl file as well ?

Could you post a link for everyone to see the result ?

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby jonli447 » Sun Jul 20, 2008 3:46 pm

I working on the XSL too. Call me crazy, but I actually stayed up last night trying to get the conditional html into the XSL (using the <xsl:comment> tags). It's been a long process, and I'm not quite finished yet. The next thing I'm trying to figure out is how to pass the POST vars and php vars correctly. (i.e. check if user is logged on, if memberlist is allowed, etc.)

This might be a bit much for an XSL Transformation, however I appreciate a challenge. dcz (or anyone for that matter) have any suggestions or ideas, I'd appreciate it.
jonli447
 
Posts: 17
Joined: Wed Oct 31, 2007 11:15 pm

Postby dcz » Sun Jul 20, 2008 4:07 pm

Well, it's a bit more problematic than this.

The xsl files are not really dynamic, there are parsed by the gym_style.php file to add some paths and language keys, but these additions are "general", and cannot easily be specialized upon each sitemap or RSS, since the script starts on a new session we would have to rebuild all the data, and we would not be able to cache the files this eazy.
So that's why there is one cache file per installed languages, to still be able to translate all the general info and display it proper, but that's pretty much up to where we can go in this case.

gym_style.php does not add the regular vars sent in the regular phpBB header either, since this would as well make the process heavier for just a css and template file.

Since we wanted this to be as fast as possible, there is not even a connection to the db when the files are cached, we could imagine to do like phpBB in style.php and provide with at least an online / offline status switch to play with, but this would necessarily mean a connexion to the db and few queries upon each css and xsl file call. Since both are called in the outptut and even though browser should cache them, it's really a lot lighter to simply read a cached file.

Until then, you can easily add custom links or menus, but it's most likely not really necessary to add extra variable to be parsed in gym_style.php, hard coding in xsl should be enough for personal use.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby jonli447 » Sun Jul 20, 2008 4:42 pm

I thought about that problem too. I was debating the best way to go about this.

My wife says I'm a perfectionist when it comes to coding (except when I post lazy regex's :-P). Now, of course on normal pages, there are quite a few links that are displayed based on session vars, i.e. for me, "memberlist" and "UCP" and "Logout" are displayed when the user is logged in, and "Register" and "Login" is displayed when the user is logged out (there's a few other links, i.e. PM too). Anyhow, of course when I accessed the transformed XSL when I was logged in, and saw the "Register" link, I wanted to fix the behavior.

But, as you're suggesting, unless one recodes gym_style.php to connect to the database and pull standard header vars, it's best to have everything hard coded.

Thanks for the incite. I may just remove the normally dynamic links then. :)
jonli447
 
Posts: 17
Joined: Wed Oct 31, 2007 11:15 pm

Postby dcz » Sun Jul 20, 2008 4:52 pm

hehe ;)

About the register link, I just though it could be an occasion to increase the probability one would register a bit and would not be to much of a pain for logged in users.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby jonli447 » Sun Jul 20, 2008 5:02 pm

@dcz That's true.

I wonder, could I perhaps write an additional file that actually obtains the normal headers, and have GYM call the file w/o really "hacking" the original GYM code? If so, it still would be neat to try to get this working as if the sitemap was a normal forum page. Perhaps then I could run some benchmarks to see if it's useful.

My thought then would be, include one more option in the GYM ACP, to "pass normal vars in XSLT" with your normal disclaimer about increasing server load.

If you don't think it would be too much of a pain, I'll give it a shot and pass it to you if you wished to include such a feature in a later version of GYM.

Thanks.
jonli447
 
Posts: 17
Joined: Wed Oct 31, 2007 11:15 pm

Postby digital1 » Mon Jul 21, 2008 4:18 am

Hello,

I have done a little edits to achieve near the result i wanted.
I not only activated the phpbb css load setting in ACP but also manually changed
Code: Select all
// Option, grabb phpBB stylesheet if using prosilver, will adapt the styling
$load_phpbb_css = false;


to

Code: Select all
// Option, grabb phpBB stylesheet if using prosilver, will adapt the styling
$load_phpbb_css = true;


in gym_sitemaps/gym_style.php

Check Out: http://www.gyanpitara.info

I have some other queries.
1. Can i show the advertisements in the outputted sitemaps and rss feeds.
2. Google in some xml files showing warning of same priority of all urls. How to fix it? The forums for which it is showing warning does not contain any url or topics.
digital1
PR0
PR0
 
Posts: 54
Joined: Fri Oct 26, 2007 6:53 am
Location: India

Postby dcz » Mon Jul 21, 2008 9:21 am

@jonli447
Well if you'd like to please do. I think the easiest way to do this would be in gym_style.php.

You could set up two scenario, the regular one which is able to output the cs and xsl files from cache without a db connection and one extra one (using a hard coded switch like : $dynamic = true;) to still allow the regular process to go on.

Then, if $dynamic = true, you could always first grab the phpBB and GYM config and required languages and always parse the css and xsl files (only xsl could be enough and better for server resources).
From there you'd need to parse all the additional variable you'd want following the way they are assigned in gym_style.php (eg without the template class to go faster) or even start the template class and do as usual.
Last thing to do would be to change the xsl (in gym_google.php and gym_rss.php) and css links (in gym_style.php) to add the SID and be able to retrieve the user status the same way it is done in phpbb/style.php (without starting an actual session to go faster).

This being said, you need to think about how worth this would be, because you'd have up t three different connexion to the db when loading a styled sitemap or rss feed (xml loads xsl wich loads css ...) so I'm not convinced it would be worth to much pain ;)

@digital1
What you did in gym_style.php is the same as activating the loading of the phpBB's CSS in acp.

1.) I'm not sure that the case is handled in the adsense TOS, they state that you should not use adsense in feeds, but in this case, they would not actually be in the feeds, but rather in the xsl files so ... if I where you, I'd ask Google or whoever your deal with first.
2.) Yes, it's not exactly where Google is the smartest, of course a sitemap with only one url has all it's url showing the same priority ...
We will though make so the announcements sitemaps and feeds will not show up unless there is at least one announce in next version.
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby jonli447 » Mon Jul 21, 2008 4:21 pm

@dcz

Thanks, I'll give it a go later tonight. I've made a couple of custom pages before that were outside of phpbb, but pulled the variables from phpbb sessions. That part shouldn't be too terrible. The part that might start to get annoying is converting those conditional HTML's to XSL. I though xsl commenting would work, but unfortunately, it does not seem to be the solution.

Anyhow, I don't know if I'll actually complete this task in a timely manner. I'll give it a try though, as it gives me the opportunity to clean up some XSL skills. :)

@digital1

Regarding your Adsense question, I think dcz is right. It's too close to violating the Adsense TOS, and once you're banned, it's hard to get your account reinstated (Trust me ... a few of us have learned the hard way. :P ). IMO, I don't think it's worth risking your account just to have ads show up on the sitemap.

That disclaimer being said, you can do it. I'll have to double check, but I believe if you change use CDATA tags for the jscript setup (i.e. the script area where you add your variables, i.e. pub-acct number, ad type,etc) ... the browser will recognize the script in the XSL transformation. It's been a while, so I'll have to double check how I got another remote jscript working with XSL. Be forewarned, it could be said that using CDATA tags instead of the exact code Google gives could be a violation of their TOS (which is silly if you ask me ... but it's their program, so their rules).
jonli447
 
Posts: 17
Joined: Wed Oct 31, 2007 11:15 pm

Next

Return to GYM Sitemaps & RSS

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 7 guests