added on Aug 6, 2009 by
Hi there,
First of all, this is a excellent script, that would be much much better with some other features. This is something
that I would like to do:
1- How can I do a query to get the last links submitted ? I want to do a section in my homepage called "Las
Submitted links", I don't see the way of make a query for this, can you guys ?
2- Also would be a good idea a search engine box, someone of you guys have get this work ?
I apreciate some kind of replays,
Thanks.
Saymon Kent
added on Aug 6, 2009 by
I'm pretty sure the link list "output" file is default - last post at the top.
So all you do is post the list like normal and the new posts go to the top. If not, there
is a setting in the "category" settings to make it random order, by date, etc...
If you only want to show the last 10 links or something like that, you could easily create
some php code that only shows the first 10 lines in the file. Part of being a webmaster
is knowing how to find php code when you need it, so I leave you to google and have fun.
added on Aug 6, 2009 by
Hi Jim, thanks for your replay.
I understand whan you said, but when I said "a query to get the last links submitted" I meant to get the las
links no matter the category they are. If I do it like you say, this is only bring the links for that category.
I'm running a website with 26 categories and what I would like to do is show the las 10 links submitted in those 26
categories.
Also I've spend days in google figuring out how to do this posible and I don't find any way yet.
So I thank any help from you.
Regards.
Saymon
added on Aug 15, 2009 by
Why do I do this?
Please learn something about PHP, I'm NOT going to do all the work for you! It
really isn't that hard, just stop watching TV for a few days and STUDY.
Even better, TRY TO DO SOMETHING YOURSELF! Doing is a better way to learn!
You can easily make a thing that prints the last 10 from ONE category and then
"include" one version of it that gets 1001, then include one that gets 1002 etc....
You could also just repeat the same code over and over in the same php file just
to make it easy. Yea you can get fancy, but I think you are just learning.
THIS IS NOT ROCKET SCIENCE! Use your nurons, it's really not that hard. You
people out there think this programming stuff is just so difficult, WHY? Just
concentrate, TURN OFF ANY DISTRACTIONS and THINK STEP BY STEP LIKE A COMPUTER DOES. Use
Google for all it's worth, all the PHP data and info is online plus there is
sample code for doing almost anything, just take little parts from here and
there and combine them together.
You MUST know this stuff to be successful at being a webmaster.
Here's how you can read in one whole category, it's standard open file and all that:
$filename = "linkex/data/output/1001";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
And here's how you can print out ALL the lines, I LEAVE IT UP TO YOUR BRAIN AND SKILL to
figure out that you can put a counter in there and limit it to print out X
number of lines and STOP. Do not expect me to hold your hand through this whole thing.
$lines = split("\n",$contents);
foreach ($lines AS $line) {
print ("$line\n");
}
(by the way I'm not the guy who wrote linkex, just a guy who uses it)