Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 123 lines (106 sloc) 4.39 KB
<?php /*
Copyright (c) ocProducts, 2004-2012
See text/EN/licence.txt for full licencing information.
Do not edit this file. If you need to make changes, save your changed file to the appropriate *_custom folder
**** If you ignore this advice, then your website upgrades (e.g. for bug fixes) will likely kill your changes ****
* @license Common Public Attribution License
* @copyright ocProducts Ltd
* @package core_ocf
/* This file exists to alleviate PHP memory usage. It shaves over 100KB of memory need for any OCF request. */
* Add the specified custom field to the forum (some forums implemented this using proper custom profile fields, others through adding a new field).
* @param object Link to the real forum driver
* @param string The name of the new custom field
* @param integer The length of the new custom field
* @param BINARY Whether the field is locked
* @param BINARY Whether the field is for viewing
* @param BINARY Whether the field is for setting
* @param BINARY Whether the field is required
* @param string Description
* @param string The field type
* @param BINARY Whether the field is encrypted
* @param ?string Default field value (NULL: standard for field type)
* @return boolean Whether the custom field was created successfully
function _helper_install_create_custom_field($this_ref,$name,$length,$locked=1,$viewable=0,$settable=0,$required=0,$description='',$type='long_text',$encrypted=0,$default=NULL)
$id=$this_ref->connection->query_value_null_ok('f_custom_fields f LEFT JOIN '.$this_ref->connection->get_table_prefix().'translate t ON','',array('text_original'=>$name));
if (is_null($id))
if (is_null($default))
return !is_null($id);
* Get an array of attributes to take in from the installer. Almost all forums require a table prefix, which the requirement there-of is defined through this function.
* The attributes have 4 values in an array
* - name, the name of the attribute for info.php
* - default, the default value (perhaps obtained through autodetection from forum config)
* - description, a textual description of the attributes
* - title, a textual title of the attribute
* @return array The attributes for the forum
function _helper_install_specifics()
return array($a,$b,$c,$d);
* Searches for forum auto-config at this path.
* @param PATH The path in which to search
* @return boolean Whether the forum auto-config could be found
function _helper_install_test_load_from($path)
global $INFO;
if (substr($domain,0,4)=='www.') $domain=substr($domain,4);
if ($colon_pos!==false) $domain=substr($domain,0,$colon_pos);
if ($pos===false) $pos=strlen(ocp_srv('PHP_SELF')); else $pos--;
if (($port=='') || ($port=='80') || ($port=='443')) $port=''; else $port=':'.$port;
return true;
Jump to Line
Something went wrong with that request. Please try again.