php

how can replace some of words when I added post from

hi , my friends .. I want to design a small plugin .. it is work is: when the user write a post for example : << WordPress >> widgets are the dynamic objects which eases the customization of the content on << sidebars >> and widgetized << footers >>. << Widgets >> allows drag-n-drop interface in the Dashboard << admin panel >>, for ea...

How to tell if optional parameter in PHP method/function was set or not?

Assume I have a method/function with the following signature: foo($bar = 0) Inside foo, how do I tell if $bar was set or not? isset will alway return a TRUE since $bar is assigned 0 in the event nothing is passed to foo. Checking for 0 is not an option. I need to know the difference between the parameter explicitly being set to 0 or ...

DESC wont work — "expects parameter to be 1"

When i try so sort my output to DESC, i get this error: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in This is my line: $queryForWall = mysql_query("SELECT * FROM users_wall WHERE uID = '$showU[id]' DESC"); while($displayWall = mysql_fetch_array($queryForWall)){ As you can see i added DESC there, ...

How to sandbox a request to another PHP script?

I have a primarily Ajax-driven site, the content of which is populated by making requests to an "operator" PHP script. While typically these requests originate in Javascript, there are occasions when it's useful to query my operator from within another PHP script. The method I have been using is to pass a URL with query string through ...

PHP/jQuery: Fadein/refresh after insert

Hi, i have a "wall" on each profile, and i wish to make it smarter, so you don't need to update the page to view your inserted message you just put up. When you insert a message, it makes a ajax call and inserts to the database, and you receive a message about it has been inserted. But right now you need to refresh the page to see your ...

Login as www-data on Debian

I have a Debian Lenny server running Apache 2.2. I run PHP using Apache's fcgi mod. PHP runs as user www-data (the default) because it's what Apache runs as and there is only one site on the server so I don't see any reason (feel free to correct me) to have the FastCGI instance run as a different user. I chown the ownership of all my PH...

Update column value or delete it if duplicated?

I have a MySQL table which has three columns: Authority | MapID | Time --------------------------------------------------------- animuson@forums | 000000000000000 | 45.6758 132075829385895 | 000000000000000 | 49.7869 qykumsoy@forums | 000000000000000 | 44.45 439854390263565...

Drupal strategy related question

Hi, i've a Drupal theory/strategy related question. First i want to say that i'm very new to the drupalling world, so this question can be quiet stupid. I'm trying to develop/make a part of a site that has the following structure: (level one) virtual_exhibitions: shows an overview of exhibition categories. (level two) themes, places, p...

How do i fix the indents in my html/php files in vim?

I am (slowly) making the switch to vim. I have added some settings to my .vimrc file (:syntax enable, :fileype plugin on, autoindent, etc.). Everything works great except when I try to indent lines using >. It double indents: <div> ----<p>this line was autoindented </p> </div> <div> --------<p>this line was indented using the > key </p...

How to use wp_enqueue_style() in my WordPress theme?

I am building out my first WordPress site for a client. I really want to use LESS for CSS and found a WP plugin named WP-LESS. Now, I am total WordPress newb, but it appears that this plugin requires me to use a function called wp_enqueue_style() to tell WordPress to process the .less file. I can't figure out where I use this function....

Cloud storage systems

I am currently using the Rackspace Cloud for cloud storage of files (pictures, videos, documents etc). I use the PHP API to access the Cloud (rather than through a public URL as I need the files to be private) but the latency on it is pretty bad. It takes about 4.5 seconds to connect. Can anyone recommend a better and faster option? ...

Displaying data from two tables.

Ok. Here is what I'm trying to accomplish. I am saving the changes to a forms textarea so that all the changes that have been made to that textarea can be viewed. Like a string of comments. I've gotten the data into the two tables. I need help getting it back out. I have data in two tables "worklog" and "worklognotes". worklog is a ser...

A question about duplicating Drupal installation on another server

Hello, I have hired a programmer overseas to develop a Drupal website for me and he has done a very good job (the site is installed at his server). I payed him and he sent me the Drupal files and the database .sql file. Here is what I have done so far: 1- I have created a database on my server named something different from the databa...

Calling a url to another server during controller response process??

Hi all, I think that I am having a slow evening but I have a question regarding calling a URL as part of a controller call in a Zend Framework application. I'm trying integrate an affiliate tracking application into my code, and the only way to register a commission is to call a url and pass the variables as either a POST or GET reques...

Is there a way to exclude domain from link generation in wordpress

I have a website that responds on *.domain.com. Going to x.domain.com or y.domain.com should produce the same web page. What * is I do not know, but it is and important piece of info since we track things based on it. When moving to wordpress we ran into a pretty severe problem. It seems to generate links (using get_page_link) with t...

Why are functions and methods so large in PHP?

I do not have a ton of PHP experience, but whenever I have been given legacy code or even recent PHP code, one thing that always strikes me is how BIG the functions are. In seems like every .php file as at least one page-long function in it. Is there any intrinsic reason why functions and methods in a dynamic, high-level language like PH...

Proxifying ASP.NET page in PHP causes AJAX error.

Hello, I'm working on building a PHP based proxy script to access a particular ASP.NET page that uses lots of AJAX. So far most of the website works, but one of the forms produces the following error upon submittal: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common ...

Do you know how to parse string which are wrapped in a keywords ?

Hi, I'm trying to parse an application with Poedit. Most of my translation use a translate() method but in some views file (.phtml) I use a special keyword such as My string Do you know could I specify to poedit ? Thank you Edit: I know how to add keyword such translate, setLabel, etc... but they are all methods. I need to add some...

$_GET shows up blank when called from a php file within iframe

Hi. I have a a login in script that is a little to complicated for my own good. I have a php file that calls a javascript based on the $_GET variable. The javascript/jquery makes html that uses iframe to call another php file, but I need the $_GET variable in that php code or I need to pass the $_GET variables to the other php file withi...

Size limit on PHP's zipArchive class?

I'm creating a zip file in PHP for the user to download. I get no errors from PHP or from checking the zipArchive class's GetStatusString function. But if I put some files into the archive, then when I try to open it, I get the error "the compressed (zipped) folder is invalid or corrupted". I've checked all the files I'm adding, they ...