FreeVPS Post Count Script.
#11
@S.L.C nice script!
Did you already considered something forum-side?
MyBB seems plugin-oriented and some plugins seems quite similar about the scope:

http://mods.mybb.com/view/post-counter

isn't it?
#12
(2014-04-17, 9:10:35 pm)Inspiron Wrote:  Would you please explain me how to install and use it? That would be helpful.

just save the script on your webserver and do

Code:
yourdamin.com/filename_of_script.php?userid=##

you can edit it as much as you want like add print to an image as this only prints a text

you could test it on my vps
Code:
http://node04.shinichikudou.tk:2623/script.php?userid=(your user id here)

@franz i requested this one which can be used as an image and can beported to another forum
#13
(2014-04-17, 8:48:16 pm)S.L.C Wrote:  
(2014-04-17, 8:47:35 pm)nomis002 Wrote:  Or you could setup a 'bot' account to crawl the posts which are hidden for Guests, quite simple to do with post data & cURL.
I've done this for several other sites etc

I was actually planing to improve it in a later version to actually bypass the Guest barrier. And to add a few other features that would improve the accuracy. I'll start working as soon as I get some good sleep because I'm tired as hell right now Cheese

Hello,

I quickly copied & modified something from my PHP Library that I made to make things easier to develop, not public because it's ugly xD.
PHP Code:
    public function Login($username$password$cookie)
    {
        
$ch curl_init(); 
        
curl_setopt ($chCURLOPT_URL'https://freevps.us/member.php'); 
        
curl_setopt ($chCURLOPT_SSL_VERIFYPEERFALSE); 
        
curl_setopt ($chCURLOPT_USERAGENT"Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3"); 
        
curl_setopt ($chCURLOPT_TIMEOUT60); 
        
curl_setopt ($chCURLOPT_FOLLOWLOCATION0); 
        
curl_setopt ($chCURLOPT_RETURNTRANSFER1); 
        
curl_setopt ($chCURLOPT_COOKIEJAR$cookie); 
        
curl_setopt ($chCURLOPT_COOKIEFILE$cookie); 
        
curl_setopt ($chCURLOPT_REFERER'http://google.com'); 

        
curl_setopt ($chCURLOPT_POSTFIELDS'username=' $username '&password=' $password .'&remember=no'); 
        
curl_setopt ($chCURLOPT_POST1);

        return 
curl_exec ($ch);
        
curl_close($ch);        
    }

    public function 
Crawl($page$cookie)
    {
        
$ch curl_init(); 
        
curl_setopt ($chCURLOPT_URL$page); 
        
curl_setopt ($chCURLOPT_SSL_VERIFYPEERFALSE); 
        
curl_setopt ($chCURLOPT_USERAGENT"Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3"); 
        
curl_setopt ($chCURLOPT_TIMEOUT60); 
        
curl_setopt ($chCURLOPT_FOLLOWLOCATION0); 
        
curl_setopt ($chCURLOPT_RETURNTRANSFER1); 
        
curl_setopt ($chCURLOPT_COOKIEJAR$cookie); 
        
curl_setopt ($chCURLOPT_COOKIEFILE$cookie); 
        
curl_setopt ($chCURLOPT_REFERER'http://google.com'

        return 
curl_exec ($ch);
        
curl_close($ch);    
    } 

I quickly inspected the post form and added the values, not tested but it can be a begin Wink.
Also, have a good night ^.^

With kind regards,
#14
I found this script is very useful in MYBB forum, Is that possible to use this script for any other forum like if we used this for phpBB forum or any other?
_________________________________________________

#15
Lol Conan, I know what other forum you are referring to Wink

@franz, that plugin does not work. We tried it here at freevps and it was immediantly removed.
[Image: img.php?userid=14559&vps1]
#16
giving the plugin a user account to crawl the forum would be a security breech, imo. the plugin would have to include the user pass combo and people would be able to use that information to try and mess up stuff in the forums.
#17
When i suggested it i thought it`s clear for all that you`ll need to find a secure way to do that in order to avoid problems. I would suggest a way but i`m not really a php expert, not even a php newbie Wink)... And i also mentioned the google crawler which doesn`t cause problems when provided whit an user/pass for websites content of which you can only view by loging in...
So Say We All
#18
nice idea though.,but why waste time to write scripts for post count? ..if the admin of freevps.us wanted something like post counts,they would have created it long time ago.lets us just continue counting our posts like how we have been counting it manually.
[Image: 2978070885.png]


Thanks to http://freevps.us and https://fuzzyhosts.com for VPS 2.and thanks to all Admins and all Moderators




#19
(2014-04-18, 5:08:16 am)ninetailfox97 Wrote:  giving the plugin a user account to crawl the forum would be a security breech, imo. the plugin would have to include the user pass combo and people would be able to use that information to try and mess up stuff in the forums.

Not really, just your CHMOD needs to be correct. And to obtain the username and the password, you would need to hack into the server. And if this is used by an admin, he/she could set-up a dummy account which can only view and not post etc.
#20
(2014-04-17, 9:10:35 pm)Inspiron Wrote:  Would you please explain me how to install and use it? That would be helpful.

The script is quite simple to use. Just copy the code to a PHP file and save it on a web-server somewhere like Conan already said. The script implements the code as functions for you to use those functions in PHP and display the data however you want.

(2014-04-17, 9:50:31 pm)franz Wrote:  @S.L.C nice script!
Did you already considered something forum-side?
MyBB seems plugin-oriented and some plugins seems quite similar about the scope:

http://mods.mybb.com/view/post-counter

isn't it?

Actually I had started to work on something similar but myBB documentation for plugin development is practically useless. I asked Nevil about this but he said that he counts the posts manually. In order for me to build a plugin like that I need to make the control panel that manages the plugin as a third party script because integrating a control panel in myBB is almost impossible in myBB without manually reverse-engineering the code since there's no documentation. I'll try to make it without building the control panel as as a third party script but it would take some time because I need to manually study other plugins and myBB it'self to have a proper knowledge about myBB plugin development.

@nomis002 now that I had a good sleep and I'm capable of coding I think I'll loon into the issues about hidden forums for guest users Smile

(2014-04-18, 12:48:53 am)umarmalik Wrote:  I found this script is very useful in MYBB forum, Is that possible to use this script for any other forum like if we used this for phpBB forum or any other?

The script code is so documented that it's practically a tutorial for building such a script. If you have the knowledge and you are ready to port it to other forums then it shouldn't be so hard. However porting it to a completely new forum (other than myBB) would involve some heavy code changes.

(2014-04-18, 5:33:36 am)emperor Wrote:  nice idea though.,but why waste time to write scripts for post count? ..if the admin of freevps.us wanted something like post counts,they would have created it long time ago.lets us just continue counting our posts like how we have been counting it manually.

It's not for the admins emperor. It's for users wishing to now how many posts they've made in a month. It's quite useful when you have a VPS and wan't to be sure you don't loose it Smile (Nevil counts posts manually anyway)


I'll probably finish this script tonight if I have some free time and start working on a plugin after that. The plugin might take some time with the current myBB documentation but I hope to finish it soon Smile




Users browsing this thread: 1 Guest(s)