Though I don't tolerate joomla for it's buggy 3rd party components , decided to look at it's core architecture, and any diagram would make my investigation efficient, thanks
I'm using the following for $headers:
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "From: " . $from . "\r\n";
$headers .= "Reply-To: ". $from . "\r\n";
$headers .= "CC: [email protected]\r\n";
My html looks fine in Gmail, however, it appears as raw html in outlook.
Did I forget something in the header?
Hello,
I want to create a website where the main pages will be served from CodeIgniter. I will use Wordpress in the /blog/ sub-directory to host the blog. Thats it! I want nothing else. Just to make sure that:
example.com/somepage/ calls a CI controller where as example.com/blog/some-post/ is handled by Wordpress.
I don't need any kind of integration or interaction between CI and WP.
Is it possible to install in that way? If not, any workarounds so that I can achieve the objectives?
Thanks and Regards,
Masnun
I've a theme which supports multiple templates, each with a header background image whose color can be set by the site owner via a colorpicker widget in my theme's options panel. This has the effect of opening the background image, recoloring it and resaving it back to the server.
I've had zero issues with this routine until recently when a customer installed the theme on a web host whose default read/write permissions are apparently much more restrictive than the norm. In this case, the user was unable to alter the colors of the template images because of the permissions settings.
I'm looking for a bit of understanding on what the permissions would need to be (assuming I purposefully set them via script) to allow the logged in wordpress user to write to files under my theme's styles directory.
The code I'm using to write to the image file is below...
$img = imagecreatefromgif("../wp-content/themes/mytheme/styles/".get_option('my_theme')."/image.gif");
$color = imagecolorallocate($img, $info["red"], $info["green"], $info["blue"]);
imagecolorset($img, 0, $info["red"], $info["green"], $info["blue"]);
imagegif($img, $path);
I'm trying to download http://www.downway1.com/dota/eng/DotA%20Allstars%20v6.67.w3x this file. But it's not able to download. It's opening unknown text. How I can set it up? Maybe I can use htaccess? but how ?
I have button on the page that being used as a link to another page. So when the user clicks the button they are redirected to the right page.
I am using the Selenium extension for PHPUnit and I would like to test that the button is correctly redirecting the user. Here is the HTML that I am trying to test:
<button onclick="window.location='/sponsor';" value="Continue" type="button" id="sponsorContinue" name="sponsorContinue">Continue</button>
I have tried a lot of different approaches to click the button, but I can't seem to get any of them to work:
$this->click("//button[@id='sponsorContinue']");
This command executes and does not throw any errors, but the page isn't redirected. It works fine when I manually click the button. What should I do?
I am displaying 5 userImage on one screen.I want to display userID and email on mouseover on those userImage.I used alt property of image control but that not working in mozila,chrome and some versions of IE.
So what are the other better ways to display info on mouseover?
in twitter
when you write @moustafa
will change to <a href='user/moustafa'>@moustafa</a>
now i want make the same thing
when write @moustafa + space its change @moustafa only
This should be a code igniter based class,
The table header should be
Price Percent_change Company Name Company Code Volume
Please help any one knows?
Many thanks!
Hello,
I have well-formed xml documents into string variables. I want to use preg_replace to add a defined attribute to every xml tags.
For example replace:
<tag1>
<tag2> some text </tag2>
</tag1>
by:
<tag1 attr="myAttr">
<tag2 attr="myAttr"> some text </tag2>
</tag1>
So I basically need the regex expression to find any start tags and add my attribute, but I'm a complete regex noob.
Thanks, kats
hello I just want to ask whether we can call a view method to a model? I know that we can call it on our controller in zend framework. Like if I want to call the url method of view on my controller I can call it like this
$this->view->url(array(),'');
and on the view we just can call it by
$this->url(array(),'');
But When I tried to call the same method on my model by
$this->view->url(array(),'');
it generates an error of call to undefined method url.
Now I want to ask whether it is possible to call view method to a model? If yes then how? What Am I doing wrong.
Thanks
I have the following query:
$this->select()
->where("`name` LIKE ?",'%'.mysql_escape_string($name).'%')
Now I have the Zend_Paginator code:
$paginator = new Zend_Paginator(
// $d is an instance of Zend_Db_Select
new Zend_Paginator_Adapter_DbSelect($d)
);
$paginator->getAdapter()->setRowCount(200);
$paginator->setItemCountPerPage(15)
->setPageRange(10)
->setCurrentPageNumber($pag);
$this->view->data = $paginator;
As you see I'm passing the data to the view using $this->view->data = $paginator
Before I didn't had $paginator->getAdapter()->setRowCount(200);I could determinate If I have any data or not, what I mean with data, if the query has some results, so If the query has some results I show the to the user, if not, I need to show them a message(No results!)
But in this moment I don't know how can I determinate this, since count($paginator) doesn't work anymore because of $paginator->getAdapter()->setRowCount(200);and I'm using this because it taks about 7 sec for Zend_Paginator to count the page numbers.
So how can I find If my query has any results?
When testing some donations on my local machine, I set various key=value pairs to do various things (return to specific thank you page, get POST data from PayPal and not GET data and others) I also built my code around the response from the PayPal sandbox.
BUT, when my code goes to the production server and we switch on live payments and test with real accounts and money, a few strange things happen;
We get a GET response from PayPal - the URL is filled with crap.
We get no transaction details. This is the biggie, no name, no txn_id, no dates, nothing. We get a handful of keys etc, its not totally empty and the payment has gone through, but nowhere near the verbosity of the sandbox.
Curious about why this might be? It doesn't really make sense to have a sandbox (or dev environment) that is substantially different from the production environment. Or, am I missing something?
EDIT: Still no response to my question in the PayPal Developer Forums. I don't even get a donation amount back from PayPal. Is this a setting maybe?
EDIT #2: Two of you have suggested to check PDT and Auto-Return. The data analytics guy for the project only 2 hrs ago suggested the same. I have asked the client to confirm this. I can't see a setting for it in the Sandbox so can assume that it is enabled by default?
I'm writing a web application that autorefreshes data with an AJAX call at set intervals.
Because it's doing that, server side user sessions never time out, since the last activity is refreshed with every ajax call.
Are there good client side rules I could implement to time out the user? I.e. should I track mouse movements in the browser, etc., or should I point the AJAX calls to URLs that don't refresh the session?
I like that my AJAX calls hit a session-enabled URL, because I can also validate that the user is logged in, etc.
Any thoughts in terms of whether I should even bother timing out the users?
Hey,
What SQL query would I have to use if I want to get the results from a table 'messages' but exclude rows that have the value in 'messages_view' where field messages.message=messages_view.id AND messages.deleted=1 AND messages_view.user=$somephpvariable
In more laymen terms, I have a messages table with each message denoted by an 'id' as well as a messages_view table connected with a 'message' field. I want to get the rows in message that are not deleted (comes from messages_view) for a specific 'user'. 'deleted'=1 when the message is deleted.
Here is my current SQL Query that just gets the values out of :
SELECT * FROM messages WHERE ((m_to=$user_id)
OR (m_to=0 AND (m_to_state='' OR m_to_state='$state')
AND (m_to_city='' OR m_to_city='$city')))
Here is the layout of my tables:
table: messages
----------------------------
id (INT) (auto increment)
m_from (INT) <-- Represents a user id (0 = site admin)
m_to (INT) <-- Represents a user id (0 = all users)
m_to_state (VARCHAR)
m_to_city (VARCHAR)
table: messages_view
----------------------------
message (INT) <-- Corresponds to messages.id above
user (INT) <-- Represents a user id
deleted (INT) <-- 1 = deleted
I have a person object.
class Person {
private $name;
...
}
I need to be able to change how they are displayed on the front-end ( visitors have control ). They can choose list view, grid view, photo view for example.
class PersonDisplay {
public function displayList() {
// Query database
// Output html to display in list mode
}
public function displayPhoto() {
// Query database
// Output html to display in photo mode
}
}
Is this an acceptable way to handle the presentation of the items on the front-end or is there a specific design pattern I should be researching to help me with this task? Does anyone have any suggestions or ideas where this could go wrong or if this could potentially make maintenance a nightmare?
The Person object was just an example very similiar to what I am using.
Hi
Hi i am using an date picker on selecting a date the date is displayed in this format
month/date/year ....
How to convert the date to this format year-month-date in date picker js itself
my js files are included through header. i dont want to have some .js files included in certain pages, while that particular page is loading. is it is possible.??? help me please.....
ok im trying to get mutual friends between these Two users, user1 and user92
This is the sql that is successful in displaying them
SELECT IF(user_a = 1 OR user_a = 92, user_b, user_a) friend
FROM friendship
WHERE (user_a = 1 OR user_a = 92) OR (user_b = 1 OR user_b = 92)
GROUP BY 1
HAVING COUNT(*) > 1
THis is how it looks
friend
61
72
73
74
75
76
77
78
79
80
81
So now i want to select all users after the number 72, and i try to do it with this sql but its not working? It gives me the error, "unknown coulum name friend in where clause"
SELECT IF(user_a = 1 OR user_a = 92, user_b, user_a) friend
FROM friendship
WHERE friend > 72 and (user_a = 1 OR user_a = 92) OR (user_b = 1 OR user_b = 92)
GROUP BY 1
HAVING COUNT(*) > 1
what am i doing wrong? or what is the correct way?? thx
I have a class which depends on 3 classes, all 3 of which have other classes they rely on. Currently, I'm using a container class to build up all the required classes, inject them into one another and return the application.
The simplified version of the container looks something like this:
class Builder
{
private $_options;
public function __construct($options)
{
$this->_options = $options;
}
public function build()
{
$cache = $this->getCache();
$response = $this->getResponse();
$engine = $this->getEngine();
return new Application($cache,$response,$engine);
}
public function getResponse()
{
$encoder = $this->getResponseEncoder();
$cache = $this->getResponseCache();
return new Response($encoder,$cache);
}
// Methods for building each object
}
I'm not sure if this would be classified as FactoryMethod or a DI Container. They both seem to solve the same problem in the same way - They build objects and inject dependencies. This container has some more complicated building methods, like loading observers and attaching them to observable objects.
Should factories be doing all the building (loading extensions etc) and the DI container should use these factories to inject dependencies? That way the sub-packages, like Cache, Response etc, can each have their own specialised factories.
I found a guide on how to add new attributes to users, it explains that for this operation I must modify some files in the app / code / core / Mage directory (the directory that contains Magento’s modules).
But if i make some changes in that folder will this affect future upgrades?
Will an upgrade will delete my changes?
Should I limit the changes only to my modules to not have problems with updates?
I want to cancel out key press event when my textarea field gets n number of characters from user. At that point i dont want user to enter any more characters. What to do?
i wonder how i could store a xml structure in a persistence layer.
cause the relational data looks like:
<entity id="1000070">
<name>apple</name>
<entities>
<entity id="7002870">
<name>mac</name>
<entities>
<entity id="7002907">
<name>leopard</name>
<entities>
<entity id="7024080">
<name>safari</name>
</entity>
<entity id="7024701">
<name>finder</name>
</entity>
</entities>
</entity>
</entities>
</entity>
<entity id="7024080">
<name>iphone</name>
<entities>
<entity id="7024080">
<name>3g</name>
</entity>
<entity id="7024701">
<name>3gs</name>
</entity>
</entities>
</entity>
<entity id="7024080">
<name>ipad</name>
</entity>
</entities>
</entity>
as you can see, it has no static structure but a dynamical one. mac got 2 descendant levels while iphone got 1 and ipad got 0.
i wonder how i could store this data the best way? what are my options. cause it seems impossible to store it in a mysql database due to this dynamical structure.
is the only way to store it as a xml file then? is the speed of getting information (xpath/xquery/simplexml) from a xml file worse or greater than from mysql?
what are the pros and cons? do i have other options? is storing information in xml files, suited for a lot of users accessing it at the same time?
would be great with feedbacks!! thanks!
EDIT: now i noticed that i could use something called xml database to store xml data. could someone shed a light on this issue? cause apparently its not as simple as just store data in a xml file?
I want to CURL to Google to see how many results it returns for a certain search.
I've tried this:
$url = "http://www.google.com/search?q=".$strSearch."&hl=en&start=0&sa=N";
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
$response = curl_exec($ch);
curl_close($ch);
But it just returns a 405 Method Allowed google error.
Any ideas?
Thanks
Currently I have this:
function parse_string($string, $variables){
extract($variables);
return eval('return "'. addcslashes($string, '"') .'";');
}
So I can input this string:
'Hi {$name}, my name is {$own_name}'
Together with this array:
array('name' => 'John', 'own_name' => 'Tom')
And get this back:
'Hi John, my name is Tom'
I've never liked this eval() approach but it works and it's fast (faster than regex at least).
Question: Is there a more elegant way to do this (faster than using regex) in PHP5?