8
Quote:
shivaji wrote:
Hi Draven
You have done a nice job but I am not agreeing with your logic. I am working with XOOPS 2.0.5.1. First of all I put your code
<{php}>
$mod = $GLOBALS['xoopsModule'];
$dirname = (isset($mod) ? $mod->getVar('dirname') :'system');
$GLOBALS['xoopsTpl']->assign( 'xoops_cmod', $dirname );
<{/php}>
<{include file="/themes/phpkaox/<{$xoops_cmod}>_meta.html"}>
in “theme.html” at meta tags section and my theme file is located at “themes\phpkaox\” folder.
Now I create some html files against each module like news_meta.html, wfsection_meta.html, contactus_meta.html, system_meta.html etc and put all those files in “themes\phpkaox\” folder. I think my procedure is correct. Isn’t?
But I am sorry to say it does not working properly. It showing some errors like
Warning: filemtime(): Stat failed for /themes/phpkaox/news.html (errno=2 - No such file or directory) in c:\inetpub\wwwroot\class\smarty\Smarty.class.php on line 1650
Can you tell me why it’s showing error?
As myth pinted out, you're trying to load the wrong file. Double check the PHP code and make sure that the _meta is there.
Quote:
2. “$xoops_cmod” variable fetching each module name and you append “_meta.html” for each module with that variable. Now you create html pages for each module, which contain meta tags and title etc. Let say I have installed 15 modules in my XOOPS and as per your logic I have to create 15 [module name]_meta.html pages and put all these pages in my selected themes directory. It is so ridiculous. Isn’t it?
Well, if you knew Smarty you could just a simply put all the metas in one html page and use IF staments to match a set of metas to the module. I was just trying to keep it simple. The whole point of my post was to give a way of doing it WITHOUT hacking the core files. I never said it was the only or best way to do it. You seem to be taking this quite personal, I'm only trying to help.
Quote:
3. Now I uninstall two modules out of 15 from my application and delete all these 2 module folders from server. If you notice carefully then you will see that those two [module name]_meta.html files are still stored in my selected themes directory. As a XOOPS module developer you know that, whenever you delete any modules from application then related files and evens tables are deleted automatically from xoops. But in this case those html files I have to remove manually from server and it does not support xoops’s basic feature.
As Myth pointed out, you can just change the URL to load from the module dir instead of the theme dir.
Quote:
4. From admin section admin can set Meta tags (keywords, description) and title. Let say
I overwrite those Meta (keyword, description) tags with your code in my theme.html. Now in my news module I want to use the default keywords and description (selected by admin). Then what I do? I already overwrite the code in theme.html. Who are familiar with XOOPS code to them it’s not a big problem but who are unaware about XOOPS code it’s a problem to them.
I agree, but as it stands now, you want them to hack core files to make this possible, I believe my solution is simpler then yours at the moment. I agree though, having this in the core and doing it through the admin panel is the best way, but until that is done, I think a none hack of core files is the best route. That way if a security update is released you don't have to worry about screwing up your install.
Again, I'm just trying to give users an alternative, I'm not trying to attack you. If people want to hack their files then by all means go right ahead, if you don't, now you have an alternative.
Thanks,
D