PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Oct 23, 2019 11:44 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Mon Feb 27, 2012 3:52 am 
Offline
Forum Newbie

Joined: Mon Feb 27, 2012 3:10 am
Posts: 4
Hello. I commissioned a php scripter and he tells me the following thing is not possible (but somehow I can't believe it's impossible because it doesn't seem to be very sophisticated). As I am not a programmer I would like to ask if this is correct.

The script does the following. It presents links and beneath the link are multiple choice questions. The user answers the question and gets the next link presented. Then the users will be matched according to their answers.

The links are stored in a .txt file. This all works except the links are presented as a "string" where the user has to click on. What I want is that the content of the links (e.g. a picture, video ...) is presented. He says that is not possible. Is he right?

Thank you very much!


Top
 Profile  
 
PostPosted: Mon Feb 27, 2012 8:41 am 
Offline
Forum Newbie
User avatar

Joined: Wed Jan 18, 2012 7:35 am
Posts: 24
Location: London
sounds like he is fobbing you off. Of course its possible to link images.


Top
 Profile  
 
PostPosted: Mon Feb 27, 2012 8:50 am 
Offline
DevNet Master
User avatar

Joined: Sun Feb 15, 2009 12:08 pm
Posts: 2794
Location: .za

_________________
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering


Top
 Profile  
 
PostPosted: Mon Feb 27, 2012 5:55 pm 
Offline
Forum Newbie

Joined: Mon Feb 27, 2012 3:10 am
Posts: 4
Thanks!

Yes, social_experiment is right. In addition these links have to be somehow identifiable because the corresponding answers have to be stored together with the links in a database. But in my understanding there shouldn't be a difference whether a simple string is fetched from a txt file or a link fetched and then embedded ..


Top
 Profile  
 
PostPosted: Mon Feb 27, 2012 6:13 pm 
Offline
Jack of Zircons
User avatar

Joined: Thu Nov 09, 2006 9:30 pm
Posts: 4484
Location: California, USA


Top
 Profile  
 
PostPosted: Mon Feb 27, 2012 9:32 pm 
Offline
Forum Newbie

Joined: Mon Feb 27, 2012 3:10 am
Posts: 4
Yes, you are right, I am German origin, so I may sound a bit confusing, sorry :) A clarifying attempt:

So what has to happen is: Questions, videos and pictures will be presented to the user. The user has to answer multiple choice questions beneath these videos, pictures (think about online questionnaires e.g.). The results of each user to each question has to be stored as we need them for further functions.

I described these questions/videos/pictures generally as "links" or maybe I should say URLs(?) because I thought they are just "objects" (I know I have to be careful with programming specific terms, so here I mean object in a general meaning) and it doesn't matter if they contain actually text, images or videos. In order to easily edit and replace these links I told him that the script should extract the links from a txt file so that our administrator can just change the links in the txt file in order to present different questions, pictures and videos.

All this works, but instead of presenting the videos and pictures, the user just gets presented simple text extracted from the txt file.

Thanks again for taking the time to help!


Top
 Profile  
 
PostPosted: Mon Feb 27, 2012 10:29 pm 
Offline
Jack of Zircons
User avatar

Joined: Thu Nov 09, 2006 9:30 pm
Posts: 4484
Location: California, USA
OK, that's much clearer. Danke sehr! :-)

Possibly that is also what is confusing your programmer. To many of us, "link" or "URL" means something you click on to reach a different web page. That could explain why he gave you those "strings" when you were expecting the actual images or videos. This is certainly possible. His code would probably need to behave differently, depending on whether the current item is an image, a video, or just a text question, so it would first need to determine which type of item is being processed, then branch to one of several actions, to display text, display an image, or embed a video player in the page that is presented to the user. I can think of several ways to do that, but to answer your question, what you have now described is possible.


Top
 Profile  
 
PostPosted: Mon Feb 27, 2012 10:40 pm 
Offline
Forum Newbie

Joined: Mon Feb 27, 2012 3:10 am
Posts: 4
I have to say "vielen Dank" :)

Now I have a backed-up argument because he told me, quote: "I have to understand the limitations of technology" ...


Top
 Profile  
 
PostPosted: Mon Feb 27, 2012 11:20 pm 
Offline
Jack of Zircons
User avatar

Joined: Thu Nov 09, 2006 9:30 pm
Posts: 4484
Location: California, USA
You may need to store a "code" (perhaps 1, 2, or 3) with each item, to indicate that it is an image, a video, or just a string. If it were me, I would not use a text file, they are much harder to work with than a simple database for such purposes, but that is certainly optional. To make it easy (indeed, much easier) for staff members to add or modify items, you would need a couple more small scripts to permit "administration" of the data in the database. Suitable databases would include MySQL, Postgres, or even the simple SQLite.


Top
 Profile  
 
PostPosted: Sat Jan 31, 2015 4:56 am 
Offline
Forum Newbie

Joined: Sat Jan 31, 2015 4:50 am
Posts: 1
This is not a question about which template engine to use.
Even the smarty example uses a switch to define pages, which is where I am trying to find a better was of doing it.

At some point you still have to define the logic path of the template, what engine you use is completely up to you.
As with the example of sub pages, even if you have 4 effective levels of pages, logic must be written to determine how you get to those pages and with each level, you are adding infinatly more code if you attempt to do this via a switch within a switch as example.

_________________
http://testking.me
http://www.testking.me/ccie-test.html
https://www.facebook.com/NotreDameOfMaryland
http://www.curry.edu/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group