Adding PHP includes to my Warp JoomlaTemplate - php

I recently purchased this script from Code Canyon and I want to work it in to my Warp Joomla template.
http://www.geertdedeckere.be/shop/thumbsup/help#template-list
I hope someone on here has some experience with the Warp framework. I have followed the creator's instructions to the T but I keep getting a white screen. Each Warp template is based on a config.php and template.config.php file. I have tried adding code as outlined on YooTheme support ticket: http://www.yootheme.com/support/question/28978 with no avail.
I also tried doing some other experiments, but while I wait on YooTheme's ridiculously long support response, has anyone the slightest idea of how I can call the initial PHP function and the CSS/Javascript files in my Warp template? I managed ot get as far as the CSS (I am unsure whether or not the init.php call is being seen, even with a relative path. The creator's original commands:
<?php echo ThumbsUp::css() ?>
<?php echo ThumbsUp::javascript() ?>
Are giving me a white screen, which I assume (and I don't know PHP inside and out / but I am tech literate) is because either the original call is not being placed before all other content output, due to a joomla structural issue I am not aware of (i.e. I am putting the code in the wrong place), or I am incorrectly placing the echo commands. Please help!

You haven't mentioned a Joomla! version so I'm presumming 2.5.x in my comments.
Putting this type of functionality in a Joomla! template is not a good idea, you would be better off looking at one of the existing extensions for Joomla! that provide "Ratings and Review" functionality including simply like/dislike options. The majority are free.
Having said that to determine the root cause of a PHP problem you will need to do the following:
Turn on "Debug System" (Site->Global Configuration->System->Debug Settigns)
Turn the sites "Error Reporting" level up,(Site->Global Configuration->Server->Server Settings). If it's currently None the start with Simple and work your way up (unless you're completely confident that you can log in modify the configuration.php file manually if the site stops working after ramping the error reporting all the way up.
N.B. Do not leave these settings on for any longer than necessary.
From the output generated you should be able to pin point the error, or the area the problem is occurring in. At that point you could extend your original question and provide us with more details like the error message, the code that causing it etc...

Related

PHP selectively includes part of a file

OK, so on some of the pages on my site, I've included a foot.php file at the end so that when I make changes to it, it effects all pages on the site. On most pages, this works perfectly, but on some pages, it just cuts off, and no includes after it take effect. The weird thing is that it includes only a portion of the file on pages where this happens.
I thought it might be because of the number of includes I used, but I have pages with more that work just fine. Take for instance, this one:
http://www.kelvinshadewing.net/codeSquirrel5.php
Here, you can see the bottom gets cut off, and if you view the source code, the rest of what goes in that div is gone, yet the div itself is closed off properly. But then go here:
http://www.kelvinshadewing.net/sprTartii.php
You'll see that the full code is there, and the Disqus app is present as well. This issue has been going on since before I added Disqus, and also happened when I'd been using includes in a different way to generate global content, so it's something about those pages in particular. It does it with only my Squirrel tutorials, and nothing else. I'm totally stumped and have no idea what's causing this. I've gone over my code a dozen times, and verified that every page uses the same PHP scripts.
As for the scripts themselves, it's just this:
<?php include "foot.php";
include "disqus.php"; ?>
The problem just disappeared, so I'm ruling it as a server glitch. If anyone else is reading this, I suggest checking out Andrew's comment, because that code was nice to know.

Drupal 7 Web Experience Toolkit - How to modify theme?

I have been going insane trying to figure out how to modify the WET-BOEW distribution of Drupal 7 and have been met with little to no results.
http://drupalwxt.github.io/
I do not have a lot of experience with drupal. I used it many years ago and I hated it as much then as I do now; unfortunately, employment requirements have forced me to dig into it again.
How do I go about modifying the theme? Even just modifying the header would be a massive step in the right direction.
For the record, the files I am modifying are in /profiles/wetkit/themes/wetkit_bootstrap/templates
Modifying system/page.tpl.php has no effect
Modifying system/html.tpl.php has an effect, unfortunately I am met with $page_top, etc and no actual markup for the header.
I am completely and utterly lost.
EDIT 1
I have created a folder under /sites/all/themes called "playground". In this file, I have added my basic info and copied the regions from the original wetkit info file.
I created the structure for <theme>/templates/system and added an html.tpl.php file containing a die() to test if it is overriding the base theme...it does not appear to be.
I make a point of clearing the cache after every change.
EDIT 2 (Solution)
It turns out that I was trying to modify the wrong file all along. For the WET-BOEW Drupal 7 distribution, changing the markup is done through <theme>/templates/panels/page--panels--wet-boew.tpl.php and by adding a custom CSS file to theme_name.info.
I'm sure this is all elementary stuff, but I've been struggling with it for a while now. Thanks for the help.
First, go to appearance page (url: /admin/appearance) and see what theme is used. Maybe you are changing wrong theme.
Then, check if page caching is on on performance page (/admin/config/development/performance). If so, you may need to clear the cache after every change with "Clear all caches" button on same page.
Oh and those system template files are usually overwritten with custom theme files. So don't change them.
Again, theme template files are usually placed in directory:
/sites/all/themes/theme_name/templates
starting from website root, so look for the files there or on some similar location if you have some specific site settings (multisite or something).

resolved Jumi code is replaced when re-editing an article in Joomla

I did following in order to include php code into Joomla:
writing a php application with jumi as:
<?php echo '<p>Hallo Welt</p>'; ?>
include following code in the target article, where the previous code should be included:
{jumi [*1]}
this worked so far.
But, when i try to edit the article again using the wyiwyg editor, the editor take the resolved formatting, means Hallo Welt and the original code get replaced {jumi [*1]}
this is get very problematic when the code is dynamic!
does somebody has a solution for this issue or am I missing something?
No It's a common problem, no worries.
There are several hack you can do to avoid this.
Save the text in one file and every time edit the file and after copy and paste in Joomla.
When you edit the file, just edit from the source.
Use an alternative editor which is already in source mode like RokPad
Check Plugin Manager > Editor - TinyMCE > Entity Encoding = raw
Using sourcerer plugging for including php script into an article, does not cause this overriding of source code by the displayed result, that's why I was forced to stop using jumi in favor of sourcerer.
Switching to raw mode is unfortunately not an option, since this would increase the effort of other authors who are supervising the platform and typing articles, especially when those are not so familiar with plain HTML.

Why "Max made me put this here"?

Every MediaWiki has a load.php.
If called without parameters it returns:
/* No modules requested. Max made me put this here */
As a curious programmer I wonder:
Why did he do this?
I am sure in a big project like this there is a good reason for it. Looks to me like it would be bad to return an empty file to an ajax query or something like it.
BTW: Normally it is called with parameters like this: load.php?debug=true&lang=de&modules=user.options&only=scripts&skin=modern&user=pi&*
This message comes from ResourceLoader.php. In the history of the file, using git blame, you can see the code was written by Roan Kattouw (RK) in this changeset. From the changeset comment:
Make load.php output a comment explaining what's going on when no modules were requested rather than outputting nothing. Max made me do this because he hates blank pages
So, your answer is, because Max hates blank pages, and if you want to know more, you should ask Roan. My guess would be that it's a debugging aid; rather than staring at a blank page wondering why it's blank, at least you know that you did something that caused a module loader request to load nothing...
As #svick points out, there is also a link to the code review, including discussion of whether it's a good idea to mention Max at all. Mentioning Max was seen as a possibility to partially close MediaWiki bug 20281, which notes that there aren't enough Easter Eggs in MediaWiki.
And that's why public repositories of open source software are cool :D
It is just to know, whats going on.
If i browse the load.php file of my MediaWiki installation with my web browser and want to check if there are any errors, they may get displayed or leave me a blank page.
A blank white page indicates a PHP error which isn't being printed to the screen.
But if i see a comment thats similar to /* No modules requested. Max made me put this here */. i do know its alright
AND that is the reason, why they needed to diff it.

Internet Explorer not rendering pages correctly because of a PHP class

I have a very strange problem and i don't know what to do about it. My site seems to work just fine all browsers other than internet explorer, so i've been trying to figure out why.
I've narrowed it down to the a file that I'm including in my site, this file is a php class that has a number of different functions like login getters and setters and so on.
I took all the php code out of my pages and it renders fine, so i added the php back in line by line and released that it stopped working when i used this:
require_once 'classes/Membership2.php';
Does anyone know why some php code will be messing with the style of my website.
For more detail on the matter, i have a number of divs that are centered, they all have curved edges as well as shadows. So by taking away the php i can see that IE is loading the page properly, no incompatibilities or anything like that.
Has anyone had a problem like this before? While i'm waiting for an aswesome or two i'll be removing functions and part of the code till i can narrow it down. (I would give code, but the file has a lot of lines of code.)
Thanks for the help.
Oh yeah and I'm testing on Internet Explorer 9 and every other browser is the latest version or close enough.
Okay so i've done some more digging into this, i've found that if i delete all the code in the class (All the functions) and leave just and empty class in the include file it still doesn't work. Okay, so in my view that means the functions aren't whats making this problem. So i deleted EVERYTHING, so now the include points to a blank php file. This worked and the page rendered as it should but obviously there is no functionality, i can't login or anything like that. I decided to add a constructor instead of leaving it as default, this function does nothing but return true; and it made the site mess up again.
Does this info change anything? Also i'm reiterating the fact that i do not get this error or any other browser but Internet Explorer 9 (Haven't tried any other IE version).
Thanks again for the help.
Okay, so i've solved the problem. At the start of my PHP class i have used
<!-- blah blah blah -->
forgetting that there is only PHP in this document and no HTML. So when i include the file it just outputs that into my source code and and messes things up, should have used the PHP commenting style.
Still strange that EVERY browser other than IE just ignores this and goes about its business, even the site that #blankabout suggested didn't give me any error (Although i assure thats because its part of the included PHP file and not the HTML itself).
as #fajran says to you, save both outputs with "view source code" on the browser and compare them to find the diference. To compare outputs use winmerge or similar tool. Once you now which text it generating the trouble, modify it inside the include file.
Given that your php, because it runs on the server, should never actually reach the browser, it may very well be some unterminated HTML or similar that is causing the problem. Perhaps the PHP is causing a break in the HTML that is unexpected.

Categories