MHalukK
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: custom post types/templatesHere are the steps I’d like to take when I find my solution;
1. create custom post type, “movies”
2. throw in a few custom fields for the custom type “movies” -> such as price, description
3. create a bunch of taxonomies again for the custom type “movies” -> such as genre, director
4. create a custom template (named specially movies.php following the convention [custom_post_type_name_here].php) which does a nice job in displaying movie post with its price, description, and clickable genre & directorso far so good… but that’s where my buck stops..
At this point, I’d like to be able to tell WordPress somehow that from now, on EVERY TIME, I ADD A MOVIE POST, that movie post is going to use movies.php as its page template without me doing anything as far as templates are concerned.
So WordPress will check the custom post type that the current post is in, and it will automatically look for that_name_here.php in its template hierarchy. So if the custom post type is “recipes”, then it will check for “recipes.php” in the theme to serve the post.
Am I clear this time?
Forum: Fixing WordPress
In reply to: wp-configYou said that “Then just make a plugin that runs where ever and whenever you want it to.”
How do you run a plug in? Thru action hooks? If so, which action hook(S) can I use in order to output an iframe code somewhere in between <body> and </body>, preferebly right before </body>.
something like
<iframe></iframe></body>
Of course, I can go to the template file and do that right there! But I’d like this iframe to run for all themes, and templates.
Forum: Developing with WordPress
In reply to: Last function that WP runsDid you just give me a plug in code? Or if not, what is it? All I can tell it’s an action. hook. And as far as I know, that should go in the functions.php of the current theme, right? please confirm.
I wish there was a single call which can output somewhere in between <body> and </body> and runs no matter what whatever the theme or template is… ( excluding rss feeds of course which are all xml ).
so you are saying that since the output of the page is handled by template, there is really no way to guarantee to run a function/procedure from the wp core for all times?
Also, what are the problems or consequences of putting an iframe as the first thing in html output, even before doc type?
what is potantially so bad about this following;
<iframe src=’whatever.inc’></iframe>
<doc type….>
<html>
…
</html>assuming what’sin between <doc type and </html> is perfectly valid.
Forum: Developing with WordPress
In reply to: Last function that WP runsThank you for your reply. That’s an excellent reply. Do you also know of an internal procedure that runs for all cases/themes which will give me the option to output a oneliner which will output <iframe><iframe> code somewhere right before </body> or right after <body>
I can do this in wp-config.php but then that <iframe></iframe> code goes out there before the <doc type>. And that is no good as far as creating a valid xhtml.
I think the best way to handle what I want is to write a plug-in but I do now know how to write one.
Forum: Fixing WordPress
In reply to: wp-configI wish I knew how to write one. I’m not a php programmer. I wrote a million lines of code in ASP but no experience in PHP whatsoever.
What I was trying to do was to combine ASP and PHP login environments together. It’s a complicated thing which I tried avoiding getting into explainations of the nitty gritty details of what I want to do.. But simply put, I’d like to develop a model a tricky model in my mind that does the following;
When a user ( be it an admin or subscriber ) login to the wp site, he will also be logging into an asp area. I wanted to pass the username thru the iframe src’s querystrings so that the ASP page can take it from there and get the users data from the wp_users table. I’ve addressed the security issues in certain ways which I do not want to share in a public forum like this. That was the purpose behind the invisible iframe. For that I happened to chose wp-config which will not be modified heavily other than that a few lines of code that try to load an iframe which does not even run a php code!
It looks like I reached an end, a dead-end trying to solve the include_once matter.
Forum: Fixing WordPress
In reply to: wp-config>>if you want to modify your admin panel, and don’t want the changes to be lost during a future upgrade, write a plugin. There are plenty of admin panel-modifying plugins available to dissect.
What I need is not an admin thing. It will run at all times for all people, logged in or not, subscriber/editor/whatever or not. So far with this thread, I’m only seeing alternative solutions and suggestions on my implementation. I appreciate this aspect as well and thank you for those suggestions/recommendations, but…
Just humor me and take the challenge I put up there. And assume that we will never edit the wp-config.php file… I’m just curious to know php wise, wp wise as to how the heck I can run that piece of code once and only once!
Forum: Fixing WordPress
In reply to: wp-configBy using sessions, I can get it to work to some degree!
session_start();
$_SESSION[‘loadcount’] = $_SESSION[‘loadcount’] + 1;
if ($_SESSION[‘loadcount’] == 1) {
echo (“<iframe width=’100%’ height=’140′ src=’/myfile.php’></iframe>”);
}But this only works for the first time I see the dashboard. If I reload the page, obviously SESSION[‘loadcount’] will go on from where it is left.
For this to work, I need to set the SESSION[‘loadcount’] down to 0 at the end of the wp. But I do not know which global process/function runs so I can go into that procedure in wp and hack it by inserting SESSION[‘loadcount’] = 0
You’d think it would be within get_footer() but I must be absolutely sure that that code must run as the last thing at all times, for both admin sections, none admin sections, for logged in users, for not logged in users, for this template/theme or that template/theme!
Forum: Fixing WordPress
In reply to: wp-configYes, but that’s an alternative solution and it may or may not work/fit to what I have in mind as to what I want to do.
I’m trying to load that iframe one time and one time only – using either global vars or using require_once. But for some reason, I do not get it work.
If anyone wants to take the challenge, do this;
open up wp-config.php and put this up at the top of the page.
<?php echo (“<h1>HELLO</h1>”) ?>
and then log in to your admin panel. you will see a bunch of HELLO’s! Try to bring it down to 1!
When you surf your blog ( the none admin sections), you will see only one HELLO. It’s only the dashboard where you see it multiple times.
Forum: Fixing WordPress
In reply to: wp-configI replaced the code I posted earlier with this;
session_start();
require_once(ABSPATH . ‘myiframecode.inc’);where myiframecode.inc contains this;
<?php
echo (“<iframe width=’100%’ height=’140′ src=’/x.php’></iframe>”)
?>The darn iframe still loads 5 times on the dashboard!
Forum: Fixing WordPress
In reply to: wp-configThat’s the only file that does not change with WP upgrades. That’s why I picked that file to place the iframe. I need it for a reason and that iframe is 0px and therefore it does not get to be seen.
But all that talk is the subject of another matter, where to put the iframe etc.
I need somebody to tell me why the heck that global variable is getting reset/or ignored?
Forum: Fixing WordPress
In reply to: Structured postsBut that plug in only makes custom fields creation easy. right? With wp3, that’s already easy.
What I was trying to ask, where is all that data stored? In a separate table? And do we use a form builder to build the form?
Forum: Plugins
In reply to: WordPress vs DrupalThank you for your comment. However, I’m really not interested in learning how “I” can implement a certain feature. Nor my goal with this thread is to get into the details of certain implementations.
On the high levels, just make points such as they say wordpress cannot do this while drupal can and here is the plug in, that proves it otherwise. That’s all.
You have already done that by pointing out on my “starter” point, that it is possible
to allow your site visitors to sign up, and you have done that by pointing to a URL. Great job in that. However, the extra comments as to I should learn the tool myself etc were not necessary. I’m afraid it will steer the thread to a different direction than the originally intended route.