Did I find the right examples for you? yes no

All Samples(18)  |  Call(18)  |  Derive(0)  |  Import(0)

        def htmlify(s):
	return s.replace('<','<').replace('>','>').replace('\n','
').replace('\t','')


src/u/4/u413-HEAD/api/reply.py   u413(Download)
		#REPLY>
		elif u413.cmddata["step"]==2:
			db.query("INSERT INTO posts (topic,title,parent,owner,editor,post,locked,edited,posted) VALUES(FALSE,'',%i,%i,0,'%s',FALSE,NULL,NOW());"%(u413.cmddata["topic"],u413.user.userid,db.escape(util.htmlify(args))))
			reload_topic(u413.cmddata["topic"],u413.cmddata["page"],u413)
	#first use of REPLY
			elif "TOPIC" in u413.user.context:
				topic=int(u413.user.context.split(' ')[1])
				db.query("INSERT INTO posts (topic,title,parent,owner,editor,post,locked,edited,posted) VALUES(FALSE,'',%i,%i,0,'%s',FALSE,NULL,NOW());"%(topic,u413.user.userid,db.escape(util.htmlify(args))))
				page=1
				if len(context)>2:
			if util.isint(params[0]):
				if len(params)==2:
					db.query("INSERT INTO posts (topic,title,parent,owner,editor,post,locked,edited,posted) VALUES(FALSE,'',%i,%i,0,'%s',FALSE,NULL,NOW());"%(int(params[0]),u413.user.userid,db.escape(util.htmlify(params[1]))))
					page=1
					if len(context)>2:
			elif "TOPIC" in u413.user.context:
				topic=int(u413.user.context.split(' ')[1])
				db.query("INSERT INTO posts (topic,title,parent,owner,editor,post,locked,edited,posted) VALUES(FALSE,'',%i,%i,0,'%s',FALSE,NULL,NOW());"%(topic,u413.user.userid,db.escape(util.htmlify(args))))
				page=1
				if len(context)>2:

src/u/4/u413-HEAD/api/edit.py   u413(Download)
					u413.type("You do not have permission to edit other user's posts.")
					return
			db.query("UPDATE posts SET post='%s',editor=%i,edited=NOW() WHERE id=%i;"%(db.escape(util.htmlify(args)),u413.user.userid,u413.cmddata["id"]))
			u413.type("Post edited successfully.")
			u413.set_context(u413.cmddata["context"])
						u413.type("You do not have permission to edit other user's posts.")
						return
				db.query("UPDATE posts SET post='%s',editor=%i,edited=NOW() WHERE id=%i;"%(db.escape(util.htmlify(params[1])),u413.user.userid,int(params[0])))
				u413.type("Post edited successfully.")
				u413.set_context("")

src/u/4/u413-HEAD/api/topic.py   u413(Download)
			output_page(topic,page,u413)
	elif params[1].upper()=="REPLY":
		db.query("INSERT INTO posts (topic,title,parent,owner,editor,post,locked,edited,posted) VALUES(FALSE,'',%i,%i,0,'%s',FALSE,NULL,NOW());"%(topic,u413.user.userid,db.escape(util.htmlify(params[3]))))
		u413.type("Reply made successfully.")
 

src/u/4/u413-HEAD/api/wall.py   u413(Download)
		if len(r)>=256:
			db.query("DELETE FROM wall ORDER BY posted LIMIT 1;")
		db.query("INSERT INTO wall(user,text) VALUES(%i,'%s');"%(u413.user.userid,db.escape(util.htmlify(args))))
		wall_func('',u413)
 

src/u/4/u413-HEAD/api/register.py   u413(Download)
					u413.type("Username already in use.")
				else:
					db.query("INSERT INTO users(username,password,access,alias) VALUES('%s','%s',%i,'[]');"%(db.escape(util.htmlify(util.stripctrl(u413.cmddata["username"]))),user.sha256(params[0]),user.User.member))
				u413.type("You are now registered.")
			else:

src/u/4/u413-HEAD/api/nsfwall.py   u413(Download)
		if len(r)>=256:
			db.query("DELETE FROM nsfwall ORDER BY posted LIMIT 1;")
		db.query("INSERT INTO nsfwall(user,text) VALUES(%i,'%s');"%(u413.user.userid,db.escape(util.htmlify(args))))
		nsfwall_func('',u413)
 

src/u/4/u413-HEAD/api/alias.py   u413(Download)
				out='<table>'
				for alias in aliases:
					out+='<tr><td style="width:2em;"></td><td>%s -> %s</td></tr>'%(util.htmlify(alias["from"]),util.htmlify(alias["to"]))
				u413.donttype(out+'</table>')
		#ALIAS to | --delete | --new

src/u/4/u413-HEAD/api/whois.py   u413(Download)
		u=db.query("SELECT * FROM users WHERE UCASE(username)='%s';"%db.escape(args.upper()))
		if len(u)==0:
			u413.type('"%s" is not a u413 member.'%util.htmlify(args.upper()))
		else:
			u=u[0]

src/u/4/u413-HEAD/api/user.py   u413(Download)
	def login(self,username,password):
		password=sha256(password)
		r=db.query("SELECT * FROM users WHERE LCASE(username)='%s' AND password='%s';"%(db.escape(util.htmlify(username.lower())),password))
		if len(r)==0:
			return False

src/u/4/u413-HEAD/api/ping.py   u413(Download)
def ping_func(args,u413):
	u413.type("PONG "+util.htmlify(args))
 
command.Command("PING","[message]",{"message":"A message for the server to return"},"Pings the server for a response.",ping_func,0)
 

  1 | 2  Next