Jump to content
xisto Community
Tsunami

You Want It, I Can Make It Request some code

Recommended Posts

Ok, i have this idea. I can make just about anything with php, so i would like to propose an offer:

 

Since i have absolutely no idea what to make i figured i could just have you guys tell me what you would like and i could make it for you. That way we both win, i get to make something without having to figure out what to make, and you get the code that you want. Sounds pretty simple doesnt it? OK! Well there are a few rules:

1) Do not post your ideas if you feel that you do not want them to be used by anyone else. However lets say that you want a forum as an example, but you dont want invisionfree or something like that, that would be ok because it is a pretty vague idea. But lets say you come up with something all of your own, dont post it here because it will be open to the public.

2) Be as descriptive as possible. You cant just say " I want a Post Thingy " And possibly want me to come any where close to what you want can i? So dont be afraid to make your post descriptive.

3) The code that i will post will be open source code viewable to the public so dont think just because i made it because you asked me to doesnt mean i made it specifically for you. Other people are aloud to use it if they wish.

4) Be reasonable. Dont ask me to code your whole site... because thats kind of limited isnt it? Lets say you want a few different things on your site... ie a CMS (Content Management System), a Chat, a forum, and a login script... Dont be like ok can you make me a site with all this stuff on it. Politely ask for a CMS and when i post the script for that ask me for something else. I will work as fast as i can.

5) I dont expect you to link back to my site. But however if you have room anywhere on your site for a link or something it would be greatly appreciated. my site is http://forums.xisto.com/no_longer_exists/


ok i hope you like this idea.

 

*NOTE: There will be instructions along with the code so dont think that your just going to have to go into it blind or anything

Edited by Tsunami (see edit history)

Share this post


Link to post
Share on other sites

I'm guessing you'd like us to post our ideas in this topic, so here it goes:I'm looking for a credits script similar to the one here at Xisto. I want it to use some made-up algorithm (which can be relatively easily changed by the user), which will calculate the credit score based on the legnth and some other factor, like number of words or something. And I would like this to be written as an SMF mod (it's not terribly hard to make one). Thw hole idea is the same as the system here, where the only indication that the system is in place is the box on the home page.Thanks for bringing in this topic.

Share this post


Link to post
Share on other sites

well my forums are messed up....when installing a mod i messed up....the error is in viewtopic.php so can you help me out? i will send you everything i have have right not in viewtopic.php.....please help me

Notice from saint-michael:
This post is off topic and also has been fixed.

Share this post


Link to post
Share on other sites

I'm guessing you'd like us to post our ideas in this topic, so here it goes:I'm looking for a credits script similar to the one here at Xisto. I want it to use some made-up algorithm (which can be relatively easily changed by the user), which will calculate the credit score based on the legnth and some other factor, like number of words or something. And I would like this to be written as an SMF mod (it's not terribly hard to make one). Thw hole idea is the same as the system here, where the only indication that the system is in place is the box on the home page.
Thanks for bringing in this topic.

You have no idea how hard this really is if you don't think it through.
What to do if a topic is moved, edited, deleted, merged...
What to do if the same happens with a post...

How do we figure a proper score for a post. Words per post, sentences per posts, words per sentence. Average syllables per word. etc, etc, etc...

Then how do we keep track of the credits, by user or by post?

I could max out the credits on this post with all the questions that you'll eventually have.

One additional thing.

This is like the third or forth version of the xisto credit script. It works very well but it took a lot of time and energy to get this far.

Share this post


Link to post
Share on other sites

ok first at aggie: Email me the stuff and ill look it over.To the other ppls: Ok, ill try to make it and hopefully post what i have tommorrow... what you mean by SMF?the best i can hope to offer you is something that when they post it the thing and it calculates it. But if you delete or move the post you will have to modify the user's credits manually. Ill also try to make a converter to show you exactly how many credits the post is worth (copy and paste it into the text box basically) and ill make a form for you to click the user's name and then it will show you the credits with the option to change them.

Share this post


Link to post
Share on other sites

trap17 credit script would be impossible to match due to the fact like vujsa theirs alot put into it. I know their are several mods at invisionize that do have point systems. But they don't count down unless you changing the coding for it to happen like that.@vujsa I think anyone who know how the credit system works that have not seen the code for it could max out credits for it. :)@aggie I already posted a not so tsunami make sure to read it as well.

Share this post


Link to post
Share on other sites

what you mean by SMF?

What I meant when I said SMF was Simple Machines Forum, an open-source forum system written in PHP/MySQL (like many others). As I mentioned, I'd like something just about invisible - the only indication it's there is some way for the user to check their credits.
For now, all it would have to be is the algorithm to calculate credits (that is of course excluding any content within quote BBcode tags), and a simple implementation of the mod. I could write some interface stuff for it myself.

Share this post


Link to post
Share on other sites

Well i dont think that the credit point system would be that tough.It is long but not that head breaking.I mean the way you get credits and the thing you get credits would be exactly reversed or recalculated whenever that thing for which the credit is given is changed or simply done with(in this case posts).Wherever you give points for the posts you reverse it or recalculate it.The main tough part is that how did you guys integrate it into the CPanel software that is on the LINUX OS to suspend the account when the hosting credits are insufficient OR to UN-suspend the same when the credits are back by way of posting.It needs to act simultaneously with the Forum and that i am unaware of.

Share this post


Link to post
Share on other sites

Credits Page

 

ok there is an example... i know its not the best in the world but it works :-p... ok, im not sure how smf works so i just left that part alone but here is the simple version of the script... you can just change the $post variable for the variable for the post and rather than echo credits just add it to a field in a mysql database or something... its totally up to you.

 

if you dont save this as credits.php you need to change 'action' in the form tag to fit your page... ie "yourpage.php?action=check"

 

<center><form action="credits.php?action=check" method="POST"><textarea name=mypost rows=20 cols=40></textarea><br><input type=submit value="Check Credit Value"></form><?if($_GET['action'] == 'check')   {	 $post = $_POST['mypost'];	 $pattern = '/\[QUOTE\](.*?)\[\/QUOTE\]/is';	 $pattern2 = '/\[quote\](.*?)\[\/quote\]/is';	 preg_match($pattern, $post, $matches);	 preg_match($pattern2, $post, $matches2);	 $post2 = str_replace($matches,"",$post);	 $post2 = str_replace($matches2,"",$post2);	 $length = strlen($post2); // below is the algorithm to change the post into credits	 $credits = round(($length/5) * .0123, 2);	 echo "<br>  This Post would be worth <b>" . $credits . "</b> credits"; } ?> </center>
i would be more than happy to clarify anything or change the code if you want me to... but this is the BASIC code...

Share this post


Link to post
Share on other sites

Credits Page

 

ok there is an example... i know its not the best in the world but it works :-p... ok, im not sure how smf works so i just left that part alone but here is the simple version of the script... you can just change the $post variable for the variable for the post and rather than echo credits just add it to a field in a mysql database or something... its totally up to you.

 

if you dont save this as credits.php you need to change 'action' in the form tag to fit your page... ie "yourpage.php?action=check"

 

<center><form action="credits.php?action=check" method="POST"><textarea name=mypost rows=20 cols=40></textarea><br><input type=submit value="Check Credit Value"></form><?if($_GET['action'] == 'check')   {	 $post = $_POST['mypost'];	 $pattern = '/\[QUOTE\](.*?)\[\/QUOTE\]/is';	 $pattern2 = '/\[quote\](.*?)\[\/quote\]/is';	 preg_match($pattern, $post, $matches);	 preg_match($pattern2, $post, $matches2);	 $post2 = str_replace($matches,"",$post);	 $post2 = str_replace($matches2,"",$post2);	 $length = strlen($post2); // below is the algorithm to change the post into credits	 $credits = round(($length/5) * .0123, 2);	 echo "<br>  This Post would be worth <b>" . $credits . "</b> credits"; } ?> </center>
i would be more than happy to clarify anything or change the code if you want me to... but this is the BASIC code...

 

I like what you have done here Tsunami. Good work.

Now if I wanted to change the nuber of points, then I would just have to play around with the line beginning "$credits = round(.....", correct? Like play around with the multipulcation or division?

Share this post


Link to post
Share on other sites

$credits = round(($length/5) * .0123, 2);

the red part is the part that determines how many credits per word...

the blue determines the number of words. It uses the same algorithm used when calculating GWAM. It takes the number of characters divided by 5 to give you the number of words (the average word is around five characters long)

 

just change the red part to fit your needs... thats just a general number that give just over 1 credit for every one hundred words or so... so just play around with it, try it out, then change it again untill it is to your liking ^.^

Share this post


Link to post
Share on other sites

You would probably be better of splitting the post into an array with any non-alphanumeric character acting as a delimter, and using the number of items in the resulting array as the number of words. You may want to exclude words under a certain length as well (eg. anything less than 3 characters), possibly even run it by a dictionary file to make sure it isn't just gibberish. It's all possible and not particularly difficult, thanks to the beauty of regular expressions. Although I've spoken to Opaque about it in the past, I'm not sure whether or not the credit system here supports the re-calculation and deduction/addition of credits when a post is edited or deleted etc., but such functionality would certainly be nice.

Share this post


Link to post
Share on other sites

Hey tsunami, a member was wondering if i had an estimate on when the search and letter not clickable feature for the youtube directory, when about will it be done? Thanks

Share this post


Link to post
Share on other sites

Ok, can you do this for me? I want a script that can be used as a login page. When a member logs himself in using it, it logs him in to a forum but then takes him to another page, in example, the index page for a personalised area for the member. Likewise, when the member logs out, it makes him leave the forums, and then takes him back to the index of the site.Do you think you can do this? The Forum Software I use at the moment is IPB 2.0, but one for SMF 1.0.8 would be good too.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.