...

View Full Version : A Generic Way To Gather Names of Networks?



inVINCEable
06-11-2007, 01:58 AM
This is a general question regarding PHP so I apologize if it is posted in the wrong section.

I was looking at digg the other day, and I was wondering if something could be done with it.

Would it be possible to create an individual digg-like website, with all the functionality, but only show the digg site to the user who belongs to that network.


For example, let's say I have a digg site for California, and a digg site for Florida, is there any way to do this, and would it help to use PHP's class/object oriented features?

smalldog
06-11-2007, 02:01 PM
Of course you can, here is your php script

http://www.phpfive.net/php-based-geo-targeting-and-localization_article42.htm

But question is, if i am from california and temporarily i live in florida then your site isn't available for me as usual if there is no choice how to display diggs for california.

inVINCEable
06-12-2007, 03:19 AM
Smalldog, thank you very much with your advice!


However, that is a little more complicated than what I need I think. I just want a seperate site, take digg as an example, for each state.

However, I want to have the user specify his network (or state) when registering, so he will only be able to write to that network.


Should I use MySQL to create a table that has all the networks, and then display the necessary result to each user based upon their network. And then link each story to an ID of a network ?


Thanks for any further help/advice.

mr e
06-12-2007, 06:42 AM
Sounds like what you want is more of a permission system, where each group is a state and only has access and can see their particular groups area.

inVINCEable
06-13-2007, 03:02 AM
Sounds like what you want is more of a permission system, where each group is a state and only has access and can see their particular groups area.


Partially, if that is what has to happen than that is fine by me. Although I assume it wouldn't be so much harder to have the group be able to have write access to their particular group, but read-only access to groups of others.


Any let's use digg here as any example.Say I create a website, with a digg page for each city in the united states. Do I want to enter the story into one table, and apply a mysql id number to each story for the city, and then search for that in the database?

My guess is that would be too much for one table and would create problems with that much text. Any suggestions?

Thanks for any further help.

mr e
06-13-2007, 03:14 AM
Off the top of my head I would probably do something like this then search for stories where the story usergroup_id equals their usergroup_id

Not sure if this is the best way though, just what I quick thought up

users
id, usergroup_id, name, password, email, etc...

usergroups
id, name, title, desc, etc...

stories
id, usergroup_id, title, etc...

inVINCEable
06-13-2007, 04:45 AM
Off the top of my head I would probably do something like this then search for stories where the story usergroup_id equals their usergroup_id

Not sure if this is the best way though, just what I quick thought up

users
id, usergroup_id, name, password, email, etc...

usergroups
id, name, title, desc, etc...

stories
id, usergroup_id, title, etc...



Yeah, that would definately work for the search engine feature. Thanks :thumbsup:


But what about actually storing the data in MySQL? Each story will have a maximum length of 1000 characters so I would just use a text field most likely. But would you store all the stories in one table? It seems after a while this table would grow to a REDICULOUS size, making search/access times very long.


What about making a network table of all the networks, and giving them all a unique ID, then creating a separate table for each network to store the stories?

Maybe I am completely off here but I am just trying to brainstorm before I start the actual db design so I have an idea of how I should do this.

Thanks again



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum