Re: [PHP] Articles system

2007-05-08 Thread Mike Shanley

Richard Lynch wrote:

Sorry for the confusion.

Think of it this way:

Content is king.

When your advertising out-weighs your content, you lose visitors.

When you lose visitors, you lose revenue.

PS
Yes, I also hate the entertainment media formerly known as news.
Any questions?
  
I haven't watched TV (except briefly when HBO had carnivale) for almost 
five years. I don't listen to the radio. I don't go to any news/culture 
websites...


Even still, I break up the pages on my site. I do it primarily because I 
write long articles, and it's better for people to bookmark the one 
short page (on my site, a page-length is about 500-750 words for me, 
maybe more) for the info they want, than to bookmark a page that they 
have to search through every single time they need that info. I'm sure 
it irks you when you want to wade through one of those EXTRA-long pages 
at php.net for some obscure usage, right?


The ads on my site are modest and not really up to google standards. 
Personally, I only ever click on ad-links when I want to support the 
website I'm on anyway. I figure other people do the same Because 
really, after the first one, whose stupid enough to Click Here to claim 
your free laptop!?


--
   ~Mike Shanley~

   ~you are almost there~

 ~no, wait. you are there!~

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Feisty Fawn and apt-get

2007-05-05 Thread Mike Shanley


Davi wrote:

First: use aptitude instead apt-get... =]
Second: use an debian-list to debian's questions instead an php-list... =]
  

Third: Go Feisty!!!

--
   ~Mike Shanley~

   ~you are almost there~

 ~no, wait. you are there!~

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Open source web Catalog ?

2007-04-25 Thread Mike Shanley
VirtueMart allows you to turn the shopping cart off. I'm not sure if 
it's only for Joomla though. :-\


Joey wrote:

Hey Guys,

 


Can anyone recommend a good open source catalog program that is NOT a
shopping cart, but a simple way for a person to maintain their products,
pictures descriptions etc?

 


Thanks!

 


Joey

  


--
   ~Mike Shanley~

   ~you are almost there~

 ~no, wait. you are there!~

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Submitting as POST. Why?

2007-04-06 Thread Mike Shanley

Chris,

When you submit via GET, all the info shows up in the URL, so people can 
tamper with it however they like. Also, people can bookmark it as well.


With POST, everything stays hidden, mostly untamperable, and 
unbookmarkable. POST might sound clearly better, but unless it's 
important that people don't change anything, then go with GET.


barophobia wrote:

My Peeps,

I only know of one reason to submit a form as POST and that is because
you can submit more data in one shot.


What other reasons are there?



Chris.



--
Mike Shanley

~you are almost there~

A new eye opens on March 5. -Omniversalism.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Using /index.php/this/that/343/3 style links but having a prob!

2007-04-05 Thread Mike Shanley

Hi,

I'm trying to make friends with search-engines, but I'm having a problem.

When I use my links (right now, I've only got the forums on my site up), 
they take me to the right place, however, the browser only displays part 
of the url...


for instance:
http://www.omniversalism.com/index.php/forums/fcat/view/1
will take you to a page titled O.com Connections

but the link shows:
http://www.omniversalism.com/index.php/forums
which would take you to the main forums page...

So what's going on???

The only code that deal with this is:
$CALL = array_values(array_unique(explode('/',$PHP_SELF)));
unset($CALL[0],$CALL[(array_search('index.php',$CALL))]);
$CALL = array_values($CALL);

and all that does is hand me the info to call my pages...

Thanks

--
Mike Shanley

~you are almost there~

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Using /index.php/this/that/343/3 style links but having a prob!

2007-04-05 Thread Mike Shanley




like in the addressbar? using IE by any chance? .. I don't see this in firefox.

  

Oddly enough, I'm using firefox and having the problem. Curious.

dunno, long night? short addressbar?
if in doubt view the source luke.
  
I keep going over the source. I have the $CALL array being printed all 
over, but nothin! Oy. I guess the people will have to live without 
bookmarks!... Or maybe just me, since it worked for you.


;-)

--
Mike Shanley

~you are almost there~

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Why won't this query go through?

2007-03-11 Thread Mike Shanley

Hi,

I am just not understanding what I could have possibly done wrong with 
this query. All of the variables are good, without special characters in 
any sense of the word... So why isn't it importing anything?


Thanks!

$q = INSERT INTO 
`visitors`(`username`,`password`,`email`,`firstname`,`lastname`,`birthdate`,`verifythis`)

   VALUES ('.$username.',
   '.md5($password1).',
   '.$email.',
   '.$firstname.',
   '.$lastname.',
   '.$birthdate.',
   '.$verifythis.');;
mysql_query($q);

--
Mike Shanley

~you are almost there~

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Holes in mysql primary key and other db issues...

2007-03-04 Thread Mike Shanley

Hi,

I'm currently on a server using mysql 4.x and I'm having a few small 
issues that I can't seem to find a decent solution to. I would 
appreciate any help.


First, I have an ID field as my primary key, but whenever I delete a 
row, that ID is not filled. This is a major problem for random calls, 
organization, etc. I don't understand what the point of all that extra 
indexing memory is for if it doesn't keep track of itself.


Second, in part of my code, I build an array of ID values and would like 
to call them all from the mysql at once, instead of a foreach(~~) 
{database call here} loop. Any ideas?


Lastly, I'd like to be able to call data from different (not joined) 
tables in a database. Aside from not being able to find info to do it, 
I'm wondering if any such solution would be worth it. What do you think?


Thanks!

--
Mike Shanley

~you are almost there~

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Holes in mysql primary key and other db issues...

2007-03-04 Thread Mike Shanley



Stut wrote:
I'm not sure what you mean by extra indexing memory. The autonumber 
feature is simple in that MySQL just keeps track of the last ID used 
and increments it to get the next one. However, I don't think there is 
any overhead caused by deleted records. If you can cite a source for 
that statement then I'd be interested to hear about it.
I mean the extra space used up to set /any/ row as a key, not overhead 
for deleting. But you're right that the auto-increment is separate from 
indexing. Even still, I need a simple way to fill those holes.



select * from tablename where id in (1,2,3,4,5,6,7)
So essentially, you're telling me not to store the ID numbers I want to 
call in an array then, eh?


If you can't join the tables together then they're not related, so 
you'll need to do separate DB calls. I'm not sure where the problem is 
here.
I'm just wondering if there's a way to combine calls to 5 different 
tables down to 1 query, as though all the info needs to be organized 
separately, it's going to the same place.


--
Mike Shanley

~you are almost there~

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Holes in mysql primary key and other db issues...

2007-03-04 Thread Mike Shanley


Stut wrote:
I have a sidebar on my site that gets a few random articles from that 
table, prints the titles, small blurbs, and a link. The link goes to 
the main article. I get the random IDs outside of mysql because I've 
made it more likely for newer articles to be chosen than older 
ones... This, accomplished via ID, because it's much easier to SELECT 
count(*) and slant my randomization to the last 25% of ID numbers 
than any other way I can think of...


Of course, this means that having holes results in empty sidebar 
boxes... And that's not too good lookin...


How are you selecting random entries? A common way to do this is to 
use the MySQL rand() function, but that is exceedingly slow.


I would suggest that you get a list of (or a subset of) the IDs in the 
table, use PHP to randomly select however many you need and then get 
the full data for those. You can't rely on the IDs, and the work 
involved in resetting all the IDs such that they're sequential without 
gaps is not worth it.
I use mt_rand(0,$max_rows) to get each of my values and send the call. 
Getting an array of IDs sounds alright for now, but also sounds like it 
gets increasingly slower and the table is expanded. I'll give it a try 
though.


--
Mike Shanley

~you are almost there~

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] WHERE problem

2007-02-20 Thread Mike Shanley
The reason I didn't go with the suggestions for this approach is that I 
want to accept new submissions to the database whose default id = 0. 
Thus, I can moderate them on the way in by giving them non-0 numbers. 
(I've changed the database row count call to fit the implementation 
since my posting of the code.)


Thanks to everyone!

[EMAIL PROTECTED] wrote:

Different strokes for different folks...

Might I toss a new recommendation into the mix?

SELECT text FROM fortunes ORDER BY RAND() LIMIT 1;
  

--
Mike Shanley

~you are almost there~

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New To PHP

2007-02-20 Thread Mike Shanley
Does your server support php? Also, some hosting services require that 
any file with php in it must end with .php ... At least, those are my 
two guesses...


Larry Chu wrote:

  html
headbasefont face=Arial/head
body
h2Q: This Creature can change color to blend in with its surroundings.
What is its name?/h2
  ?php
// print output
echo 'h2iA: Chameleon/i/h2';
?
  /body
/html
  


--
Mike Shanley

~you are almost there~

A new eye opens on March 5. -Omniversalism.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] WHERE problem

2007-02-19 Thread Mike Shanley
I'd like to think I understood code a little better than this, but I've 
got a problem with my WHERE...


I know it's the WHERE because I get a good result when I leave it out. 
And the random function is also working... I honestly can't figure it 
out. Thanks in advance for help with this laughable prob.

---
// How many are there?

$result = mysql_query(SELECT count(*) FROM fortunes);
$max = mysql_result($result, 0);

// Get randomized!... the moderated way...

$randi = mt_rand(1, $max-1);
$q = SELECT text FROM fortunes WHERE index = '$randi';
$choose = mysql_query($q);
$chosen1 = mysql_fetch_array($choose);

// Ready to ship...

$fortune = 'span class=quotecycquot;' . $chosen1[0] . 
'quot;br/-Omniversalism.com/span';


mysql_close();

--
Mike Shanley

~you are almost there~

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] WHERE problem

2007-02-19 Thread Mike Shanley

Without the single-quotes, I still get nothing returned.

Bruce Cowin wrote:

Are you getting an error or just nothing returned?  The first thing I'd check 
is if index is a numeric field and if it is, remove the single quotes from 
around $randi in the where clause.



Regards,

Bruce

  

Mike Shanley [EMAIL PROTECTED] 20/02/2007 9:23:08 a.m. 

I'd like to think I understood code a little better than this, but I've 
got a problem with my WHERE...


I know it's the WHERE because I get a good result when I leave it out. 
And the random function is also working... I honestly can't figure it 
out. Thanks in advance for help with this laughable prob.

---
// How many are there?

$result = mysql_query(SELECT count(*) FROM fortunes);
$max = mysql_result($result, 0);

// Get randomized!... the moderated way...

$randi = mt_rand(1, $max-1);
$q = SELECT text FROM fortunes WHERE index = '$randi';
$choose = mysql_query($q);
$chosen1 = mysql_fetch_array($choose);

// Ready to ship...

$fortune = 'span class=quotecycquot;' . $chosen1[0] . 
'quot;br/-Omniversalism.com/span';


mysql_close();

  


--
Mike Shanley

~you are almost there~

A new eye opens on March 5. -Omniversalism.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] WHERE problem

2007-02-19 Thread Mike Shanley

This was the problem. Thanks very much!

Brad Fuller wrote:


2) INDEX is a mysql keyword.  Try putting backticks around it.
... WHERE `index` = $randi


  


--
Mike Shanley

~you are almost there~

A new eye opens on March 5. -Omniversalism.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Quick organizational question...

2007-02-17 Thread Mike Shanley

Thanks very much Pete! Sound advice!

Peter Lauri wrote:

Hi,

No matter the size of a project using includes and config files are always a
good way to go.
  

--
Mike Shanley

~you are almost there~

A new eye opens on March 5. -Omniversalism.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Quick organizational question...

2007-02-16 Thread Mike Shanley

Hi!

Question:
For a website that will have a database driven store, articles, an rss 
feed, and a few other things... not an enormous site, but one with 
growth potential, does it makes sense to organize the whole thing as 
includes through a single main page? It seems like a fun way to do 
things, but I was just wondering what you all thought.


BTW- It's my first time here! Hello world!

--
Mike Shanley

~you are almost there~

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php