Forum Moderators: coopster & phranque

Message Too Old, No Replies

Script to pull components from different perl programs?

Would this be a hard thing to do?

         

victoryrun

7:16 pm on Aug 21, 2003 (gmt 0)

10+ Year Member



I'm about as complete a newbie as they come to scripting, but I'm curious to know how hard a script would be to write that could pull different things from different scripts and allow them to be included in an SHTML page via an SSI.

For instance, I have a webpage that has a forum, classified ads, and an "ask-an-expert" area. Through the forum script I have added a Mod that allows for "Most Recent Posts" to be called to the index.shtml page via ssi. I'm wondering if there's a way to write a script that I could do similar things for the other parts of my website. For example, I'd like to include "Most Recent Added Classifieds" and "Latest Expert Questions" to the main page. Each of these scripts, however, were free scripts that I've gathered from throughout the web and were not written by myself.

So is this a possibility? Please excuse my newbie-ness. Thanks,

Ramsey

moltar

7:24 pm on Aug 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes it is possible.

You need to figure out how the script stores data. It could be text file, database, or some other method...

Then you need to write a script that will read that data from the stored location and display it sorting by date in descending order.

You can lookup in the script and see what it does to store/read data.

Also if it is a popular script, there could be mods already written to do that. Just do a search.

Good luck!

victoryrun

7:39 pm on Aug 21, 2003 (gmt 0)

10+ Year Member



Then you need to write a script that will read that data from the stored location and display it sorting by date in descending order.
---are there any tutorials or snipets for scripts out there that I could see in order to make sure my script is right? Forgive me if I'm impatient, I want to learn, but I also want to be able to accomplish what I have in mind without waiting for forever...

Also if it is a popular script, there could be mods already written to do that. Just do a search.
---some of them are fairly popular, some of them are pretty basic.

Thanks!
Ramsey

moltar

7:50 pm on Aug 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, the best example would be the script you are using. Every script uses different ways to store data. There is no ulimate data storing solution. It all depends on the situation. Your only choice is to look in the code of the scripts that you use and find the answer there.

victoryrun

8:45 pm on Aug 21, 2003 (gmt 0)

10+ Year Member



Ok, working on my 'classifieds' script... On writing another script to retrive the lastest (lets say 10) ads from the classifieds_data.pl file and parse that data and then return the formatted output to call it via an ssi call, how would I accomplish this? classifieds_data.pl format is as follows:

30¦112¦1070¦100075¦username¦City¦State¦website¦EMAIL¦True¦Ad_contents¦8/20/2003¦10/19/2003¦2452872¦2452932¦0¦default.variables¦True¦¦¦0

I'm asuming 30 in this instance is the Ad #, as it is in decreasing value. Don't know what 112 or 1070 are, but I believe 100075 is the User #. Username, City, State, Website are user defined fields. Email, don't know if was a variable, meaning it changes based upon the users email, or what "true" next to it means. The next field is the content for the ad, and sometimes can be quite large. Next two fields are ad-run dates, but I'm not sure what the rest of the fields are for. Any ideas?

(Thanks for your help so far!)
Ramsey

[edited by: jatar_k at 5:21 pm (utc) on Aug. 22, 2003]
[edit reason] fixed sidescroll [/edit]