I am trying to get a list of news stories from a database and list them, limiting them to a just 100 characters, and rounding them off to the nearest whole sentance, with a Read More » link to read in full. I have written the code, but its not working. Code:
THe script would see the 2 terms, locate them and then see the distance based on the words that lay between them. A more advanced version would be to examine the semantic structure - and identify whether the terms occur within the same semantic element, or a sibling, or a parent etc. Thus proximity discovery of terms may be within the same paragraph, or in sequential paragraphs, or under the same "parent" (heading) but otherwise separate etc. Further - introducing things like word stemming/relationships/soundings at a later date may be useful too.
I've looked around the net (Google, here, php forums, php script sites). Not seeing anything like it. I can see tools on some sites that do similar (limited) - usually SEO based tools. I want to be able to apply this to "text" in general ... as I may apply it to uploaded word/txt files etc. I'm not seeing any real examples - so I can only assume it's mroe than a trifle to code it. How would I handle variant order of the words (Word1+Word2 / Word2+Word1)? How could I handle identifying proximity within/outside of the same element/structure?
I am creating an Image Search Engine. Currently, my script does bold the matching words on the keyword. But, some keywords are too long just like the followings. When I search for shah rukh khan, there is an image with the following keyword.
25216d1235653089 shahrukh khan s wallpaper shah rukh actor
As you see, the above keyword is too long. So, I need it to be like the following one.
Currently, I am using the following code but it requires a space before and after the bold tags. So, if the 1st word is bold, it displays the whole keyword.
so far on page one it takes word from text box and produces search on datebase for that word then produces correctly over the folling pages using pagination. question is i want it to now perform search onto words and display the 2 words. code is below. :_
I am looking for a class that converts Singular words to Plural words. My aim is to take something like Story for a model name and create a Story.php file and a stories.php file. I already have the generator class ready to roll just hoping there is some prebuilt class for converting singular to plural word otherwise i'll start this the most expected ones and work from there.
I'm looking for a way to do the following. I have a list of words of various char lengths. I have a limited number of chars I can use in a given strings size. I'd like to organize the words to fit as many of them as I can in a given string without going over the limit or cutting any of the words off.
Bobby Sally Joe Sue
I have a limit of 140 characters to fit them all in, including spaces. If I have more names than space avail in that string, I'd like to generate another string using the same function as described above until all the names in the list are used.
what i want to do is for the first page get the first 20 say and then for the second get from 21 to 40 and so on. Is this possible in the query? I can obviously code it up to do the logic in PHP but thats going to be inefficent and people might laugh at me behind my back.
i'm working on an event listing site. when someone lists an event, they can upload 3 images. Rather than uploading every single image to a single directory, i'd like to break the uploaded images out into a bunch of different directories. otherwise, any attempts to view the contents of the user image folder could result in a really LONG wait as we list a billion images. I'd like to limit the contents of any given directory to a thousand items.
I'd also like to support a very large number of events and images (1 billion? 10 billion?). I realize that many images might overload a single drive on any server, but am still determined to do it. Seems to me that some sort of recursive function might be necessary? It's easy enough to turn an event id into a folder. it's also not so hard to make a new subdirectory so there are no more than 1,000 events in a irectory. what's more difficult is when we exceed 1 million images. then my top level directory would have more than a thousand images in it.
I have a table in my database that contains fields relating to addresses. What I want to do is to give the user a choice to view all the locations from a certain county. As there can be multiple instances of a county in the table how do I ensure the county only gets displayed once. For example in the table I may have 5 entries which are:
Devon Cornwall Devon Devon Sommerset
When I retrieve all the information from the table I want to display only
I am currently creating a CMS which will allow PHP code to be used but I need to make sure that certain functions are not used that can ruin the CMS.Basically, I need a way to stop certain functions (like fopen) to be executed. The only problem I have with using str_replace to replace the text is that it also replaces any only occurrence which is not a function.
Example (replacing fopen to void): $file = fopen("/index.php", "w"); echo "I used fopen!"; Output (PHP) [code]....
I have recently started a project, and I need to limit user input. I need to make it so the user can only make 1 guess per day. It will collect all the users/guesses for one day, then at the end of the day(12 AM) I will drop all the guesses so they can start guessing again. So I just need to know how to make it so they can only make 1 guess. Code:
I have a keyword "car" in the sentence. one two three four five six seven car eight nine ten eleven twelve thirteen fourteen fifteen. i'd like it to echo three four five six seven car eight nine ten eleven twelve because 5 words before and 5 words after, including car.
I have a project for work, and I'm not sure how to efficiently do what I need to do. I'm hoping someone out there can help.
Project is this: I'm creating a web-based interface where people at my company (operators) can enter data for service calls. All data entered is run thru one or more PHP scripts for error checking and then stored in a MySQL database on a server here in the office.
What I'm looking to do is to limit access to certain operators so they can only do certain functions (ex: add a service call, but not delete one), whereas admins such as myself would have full access to everything. Ideally, at some point in the future, we plan to roll this interface out to our clients so they may do the same features within their company. Obviously, they would only gain access to data related to their company, as to protect the privacy of others.
Hierarchy would be something like this:
1. UberAdmins (such as myself) -Have access to everything and to all commands.
2. Operators -Have access to everything, but not all commands.
3. Our clients -Have access to their data only, and to all commands.
4. Our clients' operators -Have access to their data only, but not all commands.
The difficult thing is that our clients may run several businesses, so they would have to have access to several groups. In essence, they'd have multiple groups (their businesses) within a group (their group) within a group (everything).
What is the easiest and most secure way to do something like this? I'm not looking for actual code but merely suggestions. Please reply if there is something I wasn't clear on.
What I am trying to do is to limit the number of simultaneous logins of each registered user. Currently each user will be authenticated against a database and a PHP session will be created for him (say $_SESSION['username']). Then we will check for this session in all pages.
Which solution do you recommend to limit the number of simultaneous logins by each user?
as you can see you get a message in the upper left corner saying "o <-- you are here", now, noice something? Yea your in the OCEAN! I need to make a script that fits the limits of where you can be located to the edge of the land, and if the position go beyond these limits the pointer can simply be placed at the closest edge. Is there a way i can do this, and if so, how?
I've got one page in php (let's call it index.php) that from <iframe> calls another page written in php (be it application.php). How can I stop users from calling application.php on it's own? I mean if someone wants to use my application for his own site.
First thing I thought was to use $_SESSION and set some varible in index.php and then check it in application.php. But then some intruder would make an invisible frame with index.php, which will create session varible, and visible frame with application.php. Second thought is to use some kind of time-based hashes but I can't think of anything that can't be fooled.
I have this piece of code to display last ten inputs:
//Start of Last X torrents mod
$sql = "SELECT torrents. * , categories.name AS cat_name, categories.image AS cat_pic FROM torrents LEFT JOIN categories ON category = categories.id ORDER BY added DESC LIMIT 10"; $result = mysql_query($sql) or die('No torrents found'); if( mysql_num_rows($result) != 0 ) ..........