awpti
-
Posts
459 -
Joined
-
Last visited
Never
Posts posted by awpti
-
-
That's the Smarty Template file and does no work on any files. You will need to modify the code behind the file-handler to resize files.
It's perfectly possible to do, but not if you don't know PHP fairly well. You could always ask the original developers where file uploads are handled and make your modifications there.
-
So, what is the content of $data['date']?
It's obviously not what it expects.
-
Why not just specify the engine time in the CREATE TABLE line?
CREATE TABLE blah (
....
....
....
) ENGINE=INNODB;
-
Address this in their forums.
-
I would highly suggest making use of the PHPMailer class to handle this.
Also, you don't need to quote variables ("$to_email").. get rid of 'em.
-
This has nothing to do with PHP and everything to do with CSS.
-
Replace the \n with <br /> or just add a <br /> after or before the \n
-
Don't forget to validate that.
You can do that easily, since you're pulling data by an integer..
<?php if(ctype_digit($_GET['member_id'])): // do something else: // Fail - it's not an integer value! endif;
Addendum:
You don't need a while loop if you're only fetching 1 row of data.
-
If that paste is correct, your spacing is all sorts of screwed up.
And that doublequote is in the wrong place. Where's your closing PHP tag?
-
RewriteRule /member/(.*)$ member-profile.php?member=$1
Roughly.. my syntax is probably off.
Only use (.*) if you have no character limitations. If all users are purely alphanumeric and you want to (and should) enforce that.. use this:
RewriteRule /member/([a-zA-Z0-9])$ member-profile.php?member=$1
-
Use code tags and tab that beast out.
-
Try these:
ini_set('memory_limit', '512M');
Or in your .htaccess:
php_value memory_limit 512M
Otherwise there's not much you can do short of partial reads/writes until you've looped through it.
-
This is the syntax I use for arrays:
<?php $my_array = array ( 'some_key' => 'some_value', 'another_key' => 'another_value' ); Can't miss the closing parenthesis if you do it that way.
-
Of course you can run multiple language sites in a single server, just not as a single file as was suggested in your original post (from my interpretation).
File is just read based on it's file extension or AddType
Better to just refactor the entire mess to avoid that (creates unnecessary overhead).
-
He wants us to write it for him.
-
Technically, yes. Realistically, no.
That would also be completely retarded. Not even going to sugar-coat that statement.
EDIT:
I should say: Technically, NO. No current webserver can instantiate two parsing engines at once. But, if you were to develop a solution, yes. And it would still be retarded.
It would be full retard.
-
Here's a start for you, so you understand indenting (assuming you don't, for obvious reasons):
<?php $crew_check =mysql_query("SELECT * FROM crews"); while($k = mysql_fetch_object($crew_check)){ $user=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$k->owner'")); $underboss=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$k->underboss'")); $rhm=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$k->rhm'")); $lhm=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$k->lhm'")); if ($user->status == "Dead" || $user->status == "Banned"){ if ($k->underboss != "0" && $underboss->status == "Alive"){ mysql_query("UPDATE crews SET owner='$k->underboss', underboss='0' WHERE name='$k->name'"); if ($underboss->status == "Dead" || $underboss->status == "Banned"){ if ($k->rhm != "0" && $rhm->status == "Alive"){ mysql_query("UPDATE crews SET underboss='$k->rhm', rhm='0' WHERE name='$k->name'"); if ($rhm->status == "Dead" || $rhm->status == "Banned"){ if ($k->lhm != "0" && $lhm->status == "Alive"){ mysql_query("UPDATE crews SET rhm='$k->lhm', lhm='0' WHERE name='$k->name'"); } elseif ($k->lhm == "0" || $lhm->status == "Dead" || $lhm->status == "Banned"){ mysql_query("UPDATE `users` SET `crew`='0' WHERE `crew`='$k->name'"); mysql_query("DELETE FROM crews WHERE name='$k->name'"); } } } ?>
I think we can begin to see what a horrendous mess this application is. This beast needs some SERIOUS refactoring. Yikes.
I'm not going to tab anything else out for you. Good luck.
-
You're beyond help at this point, Petchy.
Tab out your code and you will find the missing braces.
-
Nothing wrong with that code.
Problem is with your query.
-
Polly want a cracker?
-
Let me put it this way:
cat junk.php | grep '{' | wc -l
85
cat junk.php | grep '}' | wc -l
76
You are missing 9 closing brackets.
And they make fun of me for using alternative syntax. HAH!
-
Custom CSS files (username+random chars? or name it the same as the subdomain).
The less you have in your database, the more performance you'll be able to squeeze out of it. The file system is always faster than a database (for, hopefully, obvious reasons) for storing relatively flat content.
Your idea will work fine - it's how WordPressMU works (though less than elegantly).
I've never seen online articles discussing this specifically, but look into a framework like CodeIgniter, Kohana or Cake to reduce development time and give you more time to sit back and consider viable options.
-
Yup, again.. Go to their forums and ask how to integrate.
They probably have documentation on custom integration. If not, their users can help you. This really isn't the right place for it (even though PHPFreaks has a Third-Party software forum)
-
Tab that garbage out.
Indentation will lead to enlightenment.
Selecting only specified 'entries' in a database with images?
in PHP Coding Help
Posted
SELECT * FROM some_table WHERE id IN(12345,213123,3412,4512,534647).
As far as attaching images to users?
Data normalization. Link the image to the user ID.
eg;
CREATE TABLE my_images (
`id` int not null primary key auto_increment,
`user_id` int, #references users.id
`image_name` varchar(128),
);