vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=139)
-   -   [release] PAPI, a phpinclude API (https://vborg.vbsupport.ru/showthread.php?t=85688)

filburt1 12-15-2002 10:00 PM

[release] PAPI, a phpinclude API
 
Version 1.0.9
to download PAPI, see the attached papi.zip several posts down

Author: filburt1
Description: The swiss army knife of the phpinclude template. A phpinclude API that allows for simpler and more readable coding of phpinclude mods. By itself, PAPI doesn't do anything. You have to write or use mods that are powered by it to actually do something.
Screenshot/Demo: n/a

DO NOT REMOVE THE COPYRIGHT NOTICE INCLUDED WITH PAPI! "Some template modifications powered by PAPI" must appear in your header or footer so I can get some recognition for writing the near-1000 lines by scratch.

Installation instructions are included in the PAPI download.

Mods that use PAPI: (reply to this thread if a mod is missing)
Features and the actual mod coming up in the next few posts.


1.0.9 (3/9/03)
Bug fixes in floodcheck() when checking simultaneously for threads and replies
1.0.8 (3/8/03)
  • floodcheck() can now efficiently check for flooding of both replies and threads at the same time
  • Various bug fixes, tweaks, and comment edits
1.0.7 (3/8/03)
  • Behavior change for floodcheck(); now is inclusive for $count instead of exclusive
  • functions to ban a user, and (given a userid) lock all threads, hide all threads, delete all threads including their replies, delete all posts, hide all posts, and split all posts into one thread added
1.0.6 (3/5/03)
  • Automatic syntax check implicitly made (errors will reference the correct line numbers in papi.php should you choose to made errors); adding papisyntaxcheck=1 has no effect anymore
  • Various bug and security fixes
  • PAPI now encapsulated in its own file for theoretically drastically improved performance and a much less crowded phpinclude template
  • englishboolean() added; returns a string version of a boolean value
  • floodcheck() added for an upcoming mod; returns true if a given user has posted more than a given number of threads/replies in a given time period
  • Extra small functions added
1.0.5 (12/26/02):
  • Bug fix in mysqlresultlessquery() (bug exists only in PAPI 1.0.3 and 1.0.4). Before the fix, mysqlresultlessquery() might echo a PHP error referencing mysql_fetch_array() and db_mysql.php.
  • updatethreadtitlecache() redocumented and new feature added; updating by threadid is now possible.
1.0.4 (12/23/02):
  • function added: cleanstring(). This takes a string and runs it through the censor and then converts HTML characters to their entities to avoid HTML injection.
  • function added: prettydate(). Given a date, formats it using vbdate and optionally even the {timecolor} replacement
  • Existing functions converted to use cleanstring() instead of htmlspecialchars(censortext()).
1.0.3 (12/19/02):
  • debug mode consolidated; now a single constant (PAPI_DEBUG_MODE) defines all debugging messages to be on or off globally. As a result, the first argument ($unused, previously $debugmode) in updatethreadtitlecache() is ignored and is now deprecated and runs the risk of being removed in 1.1.0.
  • Global query counter; $papiquerycount increments every time you call one of PAPI's mysql...() functions.
  • Function mysqlresulthandle() added (see the function's comments for details). This allows for simple queries to be included in $papiquerycounter
1.0.2 (12/16/02): provided enhanced copyright notice and version number to the actual code for clarity (no functional changes)
1.0.1 (12/16/02): fixed HTML injection issues with updatethreadtitlecache
1.0.0 (12/16/02): initial release

Nairb 12-16-2002 05:42 PM

Attach something?

filburt1 12-16-2002 05:44 PM

Features (functions included and misc junk; this list is only for 1.0.0 and many new features have been added since)
  • find out what script is running
  • make template eval code
  • echo the last mysql error or a message if no error occured
  • return the only row from a mysql query
  • return the only VALUE from a mysql query
  • execute a mysql query (UPDATE, DELETE, etc) where the result doesn't matter
  • find out if the current user is in one of a given list of usergroups
  • set a bunch of variables to empty at once
  • find out if the user is a guest
  • get the moderator permissions for a given forumid or threadid for the logged in user
  • get an array of all granted moderator permissions
  • stick/unstick a thread taking permissions into effect
  • close/open a thread taking permissions into effect
  • find out what "action" ($_GET['action'] and $_POST['action'] is
  • print_r a given array in a preformatted block in a given color
  • add ... to a string if it is greater than a certain length
  • run multiple queries at once
  • update the last thread title cache all at once or for one given forum (this is proprietary to a soon-to--be-released mod)
  • emulate register_globals for a given list of $_POST vars
  • automatically run a syntax check on PAPI itself

Yeesh!

As per the syntax check on PAPI itself, just tack &papisyntaxcheck=1 onto any URL and it will echo "PAPI syntax check ok" if so.

File coming up.

The copyright notice it adds and that you cannot remove (except for the version number):

filburt1 12-16-2002 05:45 PM

Download for PAPI:

Nairb 12-16-2002 05:48 PM

Lol, Ok
Thx :D

Is there a way you could give examples of all those codes, but writen in PAPI? O_o

filburt1 12-16-2002 05:49 PM

I'm going to release a completely rewritten version of my last thread titles on forumhome mod soon that requires PAPI to run, so you can tear apart that.

filburt1 12-16-2002 06:14 PM

1.0.1 updated (see version history)

Brad 12-16-2002 07:04 PM

Now that its final i can start using it, look for a mod with it included from me soon.

Rufus69 12-16-2002 10:57 PM

o_o

I'm going to try and install it, if it messes up imma kill you!

Cypher720 12-16-2002 11:36 PM

same...lol


All times are GMT. The time now is 01:42 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01267 seconds
  • Memory Usage 1,744KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete