How to make a basic Forum Thread on my website ?
Like they click it shows the thread without going to a new page and what not.
EDIT*** Like the user he clicks something that says Thread or a Programming* and it shows all the posts and they may view that post as if it were on a whole new page without the Programming and thread just the post.
You wont be able to do this PHP only...
You can do this with JavaScript though I prefer JQuery as it makes dealing with JavaScript easier. This is a great tutorial on getting started with JQuery which covers show/hide effects (which is what you want to look at to achieve the functionality you've described.)
http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery
Good Luck!
Related
Intro: I'm a newbie on both php and Javascript and have been trying to solve this issue for my site (another version of this issue here), but have had trouble putting into effect the answer by LocalPCguy.
(in short: the issue is that with infinite scroll activated, the social buttons work on the first posts that are loaded, but do not work for posts loaded subsequently).
I am working off of a WordPress them, and I've added my social buttons to an existing php file that generates most of the appearance of each post. I seem to be adding them to the right place because the buttons appear where I want them to on each post (only for the first ones on the page). Like the other two guys who posted about this problem, I am using digg digg as my social plugin.
Currently the code in the php file that generates the social buttons looks something like this:
<div class="sharing-button">
<?php dd_google1_generate('Compact (20px)') ?>
</div>
Like I said, this makes the button appear for the first posts that are loaded, but once the infinite scroll tries to load additional posts, the social button will not appear on those posts.
For now I have tried the following:
Add the code below just above or below (taken from the answer here), or inside my <div> containing the buttons in the php file.
if (typeof gapi !== "undefined") { gapi.plusone.go(); }
That didn't work I figured it was because a .php file would need some kind of signal to know that it needs to run a javascript operation. So I looked around and found a couple suggestions on how to do this, here and here. In neither case did I manage to get the buttons to appear appropriately. Below was what seemed like the least idiotic of those attempts:
<?php
echo '<script type="text/javascript">
if (typeof gapi !== "undefined") { gapi.plusone.go(); }';
echo '</script>';
?>
I also thought perhaps I needed to pass an argument into gapi.plusone.go(), and I tried passing my sharing-button <div> above, but that did not work either (php code inside a javascript script inside a php block... didn't have high hopes).
At this point I'm not sure what to do - I feel like the solution is probably quite simple but I'm completely stuck, having spent hours reading threads about javascript integration into php and the like.
Does anyone have an idea how I can go about applying that Javascript solution to my .php dependent Wordpress theme?
Many many thanks!
Short Answer: this is not possible.
Long Answer:
FIRST comes PHP, SECOND comes javascript.
The PHP "program" is run at the Server, which is you web provider's server. This server works out all the PHP stuff. After this one is finished, the files of the Website are sent to your computer. It contains, among other stuff, javascript.
And this javascript is only run on YOUR computer, the one you're looking at. Once your Browser loaded the page and starts running javscript, it's already too late to ask the Server for some more info.
There are techniques allowing for that (AJAX is the Keyword), but that's another question :-)
You need to initiate the javascript of the buttons for them to work since infinite scroll loads the next set of posts using ajax. One example I found but it only does it for facebook if the plugin uses FBML:
$(document).ajaxComplete(function(){
try{
FB.XFBML.parse();
}catch(ex){}
});
I'm using a custom implemented Like Box from facebook and infinite scroll and this works just fine.
I'm Developing an application, that have several Pages for the application. And In it i thought to Say one information in it, it the user like to proceed means they can continue or can drop that..
Now i have query like,..
<input type="Button" onclick="window.open(myPage.php)" target="_blank" value="Guess It..!"/>
It opens a new page for showing the Data,.. Its looking good. But just now i came to knew about the Lightbox functionality in PHP with javascript. I Heard that it will perform my process in the Same page without disturbing the Previous one, it came as pop-up and after completing its Process we can close and continue our previous process..
I Hope i will help to my user to work easily without any confusion with the New Tab Open option, now i'm searching for the lightbox Tutorial, anybody suggest me for the Best tutorial or examples..
I think you shuuld look at Fancybox. Good documentation, easy to use, you can dynamic load content, images etc.
There is also tutorial and documentation.
http://fancybox.net/
Download and use this fancy box..This will be easy for you to implement and customize based on reqs.
For using it, refer http://fancybox.net/howto.
Hope it helps.
I'm pretty new to the world of web developing and web design in PHP, but I was hoping that someone could help me with my question.
I am loading a particular page on my PHP powered website which loads an iframe from another page elsewhere in the center of the page. I was wondering if anyone knows how to only get the whole page to load once the iframe has loaded. It's only a matter of a further one or two seconds before the iframe loads, but this needs to look as professional as possible.
I'd appreciate any help. I'd also like to assure you guys that although this is my first question, I know how Stack Overflow works as one of my best friends is a contributors here and he's always telling me how annoying it is when people don't respond or give points to good answers, so I'd like to assure you that I will do that.
Thanks again.
Steve.
Use JQuery. You won't be able to do this in PHP, as it's a client side issue.
function callIframe(url, callback) {
$(document.body).append('<IFRAME id="myId" ...>');
$('iframe#myId').attr('src', url);
$('iframe#myId').load(function()
{
callback(this);
});
}
See:
jQuery .ready in a dynamically inserted iframe
I'm trying to make a Facebook application that utilises the multi-friend-selector to let someone answer a question. (eg: why do you think is the most awesome? you get multi friend selector below, choose someone and click post to his wall).
I've the post to wall part working fine using PHP. Right now though the friend to be asked a question is picked randomly.
Now the question. Is there a way to use PHP to render a multi-friend-selector or do i HAVE to go back and do this whole thing using Javascript?
The multi-friend-selector is under Facebook's control and you cannot use for anything other than sending invitations. So unfortunately you'd have to use your own. Fortunately though, someone else already had this problem and wrote one for you: Facebook – Friends selection custom component. Note that it does use some JavaScript.
Just a couple questions about building websites. I know the basics of building a website, but there are a few things I was wondering about. The first thing is about posting on the main page. What I mean is if I want to set up an admin page where me or the other admin want to login and fill in the box and click post, how do you post to another HTML page? Can I just use php and if so how do you make it continually post the same way every time someone makes a post. The second thing is that when someone normally sets up an admin page or any kind of login page do they store the username and password in a mysql page? These may seem basic to some, but I have never had to do these types of things yet.
I suggest that you download and install Wordpress. This will take care of all the admin editing, security and posting to the front page for you. It's written in PHP and very easy to get started with. You can dip your toes into these deep waters! :)
good luck,
JD
You should learn PHP and Mysql. Mysql is a database, all your username/password/posting info will be stored there. And your PHP will do the updating or query content/posting from database to display in any page.
Read more at : http://www.freewebmasterhelp.com/tutorials/phpmysql