ANY PHP CODERS?

Qaybta Xirfada Sayniska iyo iwm

Moderators: Moderators, Junior Moderators

User avatar
waryaa
SomaliNet Super
SomaliNet Super
Posts: 5889
Joined: Mon Apr 30, 2001 7:00 pm

ANY PHP CODERS?

Post by waryaa »

We need a small intelligent php/mysql script. If you can run apache (or any other webserver/php/mysql on your personal computer and have the ability to write a clean, sane and secure code in PHP then you can be our hero :) I can do it myself but too tied up with other stuff.

I will post what this script must accomplish with some instructions. However, I need to see if we have programmers in the community before I post the details. It is for this forum and 100% voluntary work. One person can do it or we can have a few guys work together as a team.

Anything that's not related to this topic will be deleted.
User avatar
IRONm@N
SomaliNet Super
SomaliNet Super
Posts: 5122
Joined: Tue May 01, 2001 7:00 pm
Location: Jannatul-Fardowsa
Contact:

Re: ANY PHP CODERS?

Post by IRONm@N »

<script language= "php">
print "hello waryaa, are you administrator?"
</script>

I think haxxor and other do Script language, you should post this topic in Engineering and Computerscience section

viewforum.php?f=3
User avatar
waryaa
SomaliNet Super
SomaliNet Super
Posts: 5889
Joined: Mon Apr 30, 2001 7:00 pm

Re: ANY PHP CODERS?

Post by waryaa »

thnx bro - i never knew that forum was active! I'll do it :)
haxxor
SomaliNetizen
SomaliNetizen
Posts: 973
Joined: Thu Oct 28, 2010 2:48 pm

Re: ANY PHP CODERS?

Post by haxxor »

IRONm@N wrote:<script language= "php">
print "hello waryaa, are you administrator?"
</script>

I think haxxor and other do Script language, you should post this topic in Engineering and Computerscience section

viewforum.php?f=3
Yeah I can do some PHP. Although, your code was totally wrong -_-
User avatar
waryaa
SomaliNet Super
SomaliNet Super
Posts: 5889
Joined: Mon Apr 30, 2001 7:00 pm

Re: ANY PHP CODERS?

Post by waryaa »

thnx guys.

This script will do some automated house cleaning periodically via cron job.

task:
1- read general forum topics that have not been updated after last script run and before the past 48 hours, let's say 200 topics at a time.
2- for each topic check if it contains any forum name
3-
a. if it finds a forum name, let's say Canada, move the topic to Canada forum
b. if it contains more than one forum name, like Canada and Gedo, get topic name and id and store them in an array
4- at the end of each batch (200 topics or x #)
a- if the above mentioned array contains data, post an automated topic on a preselected moderator forum with the name and link to each topic that has two or more forum names in it.
b. go to the next batch.
5- at the end, produce some statistics like the number of topics read, moved, marked for manual move, time stared, time ended.
6- save the timestamp of when the script started on a flat file. Is is needed for the next run.

We basically want to auto move topics after 48 our of inactivity to a more suitable forum. for instance, this link shows you many "Gedo" topics some of which very important that are buried deep in the general section. This script will move such topics to most suitable forum in the background after 48 hours of inactivity.
search.php?keywords=gedo&terms=all&auth ... mit=Search

How to:
1. install apache/mysql5/php5 on your computer
2. download and install phpbb3's (latest subversion)
3. create x number of forums (destination - you will be moving topics to these forums)
4. create the source forum (like the general here) and populate with topics most of which with the names of other forums
5- create another forum for posting messages for moderators
6- spend time on phpbb database and its tables

write the code.
don't worry about security. we will sanitize it if necessary.
don't worry about authentication either.

just plain php code that:
accesses topics and forums tables
modifies topics table to change forum_id for topics being moved
posts automated topic on a preselected forum (you can skip this part, it needs some tweaking and more time. Just dump the array to a flatfile with the timestamp_multi_forum.txt as a filename.

CAN YOU GUYS DO IT?

Students: you will be able to add "created custom software for a very large community website on your resume.

I might post some pseudo code to make it easier for you.

tnx again...
haxxor
SomaliNetizen
SomaliNetizen
Posts: 973
Joined: Thu Oct 28, 2010 2:48 pm

Re: ANY PHP CODERS?

Post by haxxor »

waryaa wrote:thnx guys.

This script will do some automated house cleaning periodically via cron job.

task:
1- read general forum topics that have not been updated after last script run and before the past 48 hours, let's say 200 topics at a time.
2- for each topic check if it contains any forum name
3-
a. if it finds a forum name, let's say Canada, move the topic to Canada forum
b. if it contains more than one forum name, like Canada and Gedo, get topic name and id and store them in an array
4- at the end of each batch (200 topics or x #)
a- if the above mentioned array contains data, post an automated topic on a preselected moderator forum with the name and link to each topic that has two or more forum names in it.
b. go to the next batch.
5- at the end, produce some statistics like the number of topics read, moved, marked for manual move, time stared, time ended.
6- save the timestamp of when the script started on a flat file. Is is needed for the next run.

We basically want to auto move topics after 48 our of inactivity to a more suitable forum. for instance, this link shows you many "Gedo" topics some of which very important that are buried deep in the general section. This script will move such topics to most suitable forum in the background after 48 hours of inactivity.
search.php?keywords=gedo&terms=all&auth ... mit=Search

How to:
1. install apache/mysql5/php5 on your computer
2. download and install phpbb3's (latest subversion)
3. create x number of forums (destination - you will be moving topics to these forums)
4. create the source forum (like the general here) and populate with topics most of which with the names of other forums
5- create another forum for posting messages for moderators
6- spend time on phpbb database and its tables

write the code.
don't worry about security. we will sanitize it if necessary.
don't worry about authentication either.

just plain php code that:
accesses topics and forums tables
modifies topics table to change forum_id for topics being moved
posts automated topic on a preselected forum (you can skip this part, it needs some tweaking and more time. Just dump the array to a flatfile with the timestamp_multi_forum.txt as a filename.

CAN YOU GUYS DO IT?

Students: you will be able to add "created custom software for a very large community website on your resume.

I might post some pseudo code to make it easier for you.

tnx again...
A script running automatically is not my thing, although I can make it so when you choose to run it, it runs. I'm trying to write it as of now...
User avatar
waryaa
SomaliNet Super
SomaliNet Super
Posts: 5889
Joined: Mon Apr 30, 2001 7:00 pm

Re: ANY PHP CODERS?

Post by waryaa »

bro haxxor, don't worry about the automation. I'll have that part taken care of. tnx a lot!
Fortran
Posts: 44
Joined: Tue Mar 10, 2009 2:02 pm
Location: Rock City

Re: ANY PHP CODERS?

Post by Fortran »

I just finished drupal project, I'm not a php coder but I have about 6yrs coding in Asp.net/C#/VB.net/SQL server. Question for php folks? How come php doesn't implement objects(oop). Multidimensional array is so primitive.

Installing php on window machine - I did this few months ago.

- Download WAMP Server - http://www.wampserver.com/en/ - contains php, apache, mysql and phpmyadmin(nice tool)
- edit the port number to (8080), IIS (internet information system listens to port number 80)
-
User avatar
waryaa
SomaliNet Super
SomaliNet Super
Posts: 5889
Joined: Mon Apr 30, 2001 7:00 pm

Re: ANY PHP CODERS?

Post by waryaa »

Thanks Fortran. all-in-one WAMP server is a good choice for windows users.

php is now full OOPS programming language and yes, it has multiarray functionality. you can google both :)
djibsomali
SomaliNet Super
SomaliNet Super
Posts: 5229
Joined: Fri May 25, 2007 6:39 pm

Re: ANY PHP CODERS?

Post by djibsomali »

I am not a php programer!
sorry
User avatar
Rightwing
SomaliNet Super
SomaliNet Super
Posts: 9248
Joined: Mon Dec 23, 2002 7:00 pm
Location: Maqaamka lagu xadreeyo MEDED, MEDED
Contact:

Re: ANY PHP CODERS?

Post by Rightwing »

I am ok with PHP. I will let you know this weekend If I am capable to do this task.
User avatar
IRONm@N
SomaliNet Super
SomaliNet Super
Posts: 5122
Joined: Tue May 01, 2001 7:00 pm
Location: Jannatul-Fardowsa
Contact:

Re: ANY PHP CODERS?

Post by IRONm@N »

This will be a good summer project for computer science students, and you could put it in your resume.

haxxor what is wrong with my code?

you could use both ways

<?
php code
?>
or
<script language = "php>

PHP code

<script/>
haxxor
SomaliNetizen
SomaliNetizen
Posts: 973
Joined: Thu Oct 28, 2010 2:48 pm

Re: ANY PHP CODERS?

Post by haxxor »

IRONm@N wrote:This will be a good summer project for computer science students, and you could put it in your resume.

haxxor what is wrong with my code?

you could use both ways

<?
php code
?>
or
<script language = "php>

PHP code

<script/>
Just googled it, oops I think I made a mistake. It's thing I've never heard of, due it's being server side, not client side.

Although I think it will be visible in source file so, you run into risk of getting your code copied by anyone.
User avatar
IRONm@N
SomaliNet Super
SomaliNet Super
Posts: 5122
Joined: Tue May 01, 2001 7:00 pm
Location: Jannatul-Fardowsa
Contact:

Re: ANY PHP CODERS?

Post by IRONm@N »

afisoone wrote:I am not only php programmer, sida quranka loo xafido ayaan u xafiday...
you got all talk and no action? talk this project if you proficient in PHP.
User avatar
waryaa
SomaliNet Super
SomaliNet Super
Posts: 5889
Joined: Mon Apr 30, 2001 7:00 pm

Re: ANY PHP CODERS?

Post by waryaa »

lol@iron -

thnx guys,

Here are two files that may get you started. They are no way close to complete or perfect, just to give you an idea...

file 1: moveit.php
file 2: dbase.inc


You can populate dbase.inc with all of your dbase related functions.
No need to use these files or classes/methods. Plain sequential code in one file is fine too.

Code: Select all




moveit.php

<?
require("dbase.inc");			// database functions

// Open the database
$db = new dBase;
if(!$db->init()) {
	echo "Cannot open database<BR>\n";
	exit;
}

do your thing here....

//you can access those functions like this
  $total =  $db->get_total();  
?>

#########################################################333


dbase.inc
<?php

Class dBase
{
	var $DBASE = "dummy";		// database name
	var $USER = "dummytester";			// username
	var $PASS = "dumber";			// password
	var $SERVER = "localhost";		// server name
	var $AUTOMOVE = yes;	// automatically move topics
	var $REQUIRE_PW = false; 
	var $TOPIC_TBL = "phpbb3_topics";	// table name for topics
	var $FORUM_TBL = "phpbb3_forums";	// table name for forums

	var $CONN = "";
	var $TRAIL = array();

	function error($err)
	{
		$nun = mysql_errno();
		$message = mysql_error();
		echo "[$err] ( $num - $message )<BR>\n";
	}

	function init ()
	{
		$user = $this->USER;
		$pass = $this->PASS;
		$server = $this->SERVER;
		$dbase = $this->DBASE;

		$conn = mysql_connect($server,$user,$pass);
		if(!$conn) {
			$this->error("Connection failed");
		}
		if(!mysql_select_db($dbase,$conn)) {
			$this->error("Select failed");
		}
		$this->CONN = $conn;
		return true;
	}



	function select ($sql="", $column="")
	{
		if(empty($sql)) { return false; }
		if(!eregi("^select",$sql))
		{
			echo "<H2>outch!</H2>\n";
			return false;
		}
		if(empty($this->CONN)) { return false; }
		$conn = $this->CONN;
		$results = mysql_query($sql,$conn);
		if( (!$results) or (empty($results)) ) {
			mysql_free_result($results);
			return false;
		}
		$count = 0;
		$data = array();
		while ( $row = mysql_fetch_array($results))
		{
			$data[$count] = $row;
			$count++;
		}
		mysql_free_result($results);
		return $data;
	}

	function insert ($sql="")
	{
		if(empty($sql)) { return false; }
		if(!eregi("^insert",$sql))
		{
			echo "<H2>Outch!</H2>\n";
			return false;
		}
		if(empty($this->CONN))
		{
			echo "<H2>No connection waryaa!</H2>\n";
			return false;
		}
		$conn = $this->CONN;
		$results = mysql_query($sql,$conn);
		if(!$results) 
		{
			echo "<H2>Empty basket!</H2>\n";
			echo mysql_errno().":  ".mysql_error()."<P>";
			return false;
		}
		$results = mysql_insert_id();
		return $results;
	}

	function sql_query ($sql="")
	{
		if(empty($sql)) { return false; }
		if(empty($this->CONN)) { return false; }
		$conn = $this->CONN;
		$results = mysql_query($sql,$conn);
		if(!$results) 
		{
			echo "<H2>Crazy Query!</H2>\n";
			echo mysql_errno().":  ".mysql_error()."<P>";
			return false;
		}
		return $results;
	}

	function sql_cnt_query ($sql="")
	{
		if(empty($sql)) { return false; }
		if(empty($this->CONN)) { return false; }
		$conn = $this->CONN;
		$results = mysql_query($sql,$conn);
		if( (!$results) or (empty($results)) ) {
			mysql_free_result($results);
			return false;
		}
		$count = 0;
		$data = array();
		while ( $row = mysql_fetch_array($results))
		{
			$data[$count] = $row;
			$count++;
		}
		mysql_free_result($results);
		return $data[0][0];
	}


///// do your thing here.... like .....

	function get_total ()
	{
		$sql = "select count(*) from $this->FORUM_TBL where (add conditions, etc ******* )";
		$results = $this->sql_cnt_query($sql);
		return $results;
	}



	function get_forumlist($start=0,$batch=200)
	{
		$sql = "SELECT forum_name, forum_id FROM $this->FORUM_TBL ORDER BY forum_name DESC LIMIT $start,$batch";
		$results = $this->select($sql);
		return $results;
		
	}

		

	//update topic

	function update_topic ($forum="")
	{
		$err_msg="";

		if(empty($forum)) { 
			$err_msg = "No forum given.";
			return false; 
		}
		$mytime=time();
		$sql = "UPDATE $this->TOPIC_TBL SET forum_id = '$forum'";
		$results = $this->sql_query($sql);
		return $results;
	}

//end update topic




}	//	End Class
?>
Locked
  • Similar Topics
    Replies
    Views
    Last post

Return to “Careers - Engineering, Science & Computers”