Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
2 + 9 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     
_name; } /** * get the "action" attribute for the tag * * @return string */ function getAction(){ return $this->_action; } /** * get the "method" attribute for the tag * * @return string */ function getMethod(){ return $this->_method; } /** * Add an element to the form * * @param object &$formElement reference to a {@link XoopsFormElement} * @param bool $required is this a "required" element? */ function addElement(&$formElement, $required=false){ if ( is_string( $formElement ) ) { $this->_elements[] = $formElement; } elseif ( is_subclass_of($formElement, 'xoopsformelement') ) { $this->_elements[] =& $formElement; if ($required) { if (!$formElement->isContainer()) { $this->_required[] =& $formElement; } else { $required_elements =& $formElement->getRequired(); $count = count($required_elements); for ($i = 0 ; $i _required[] =& $required_elements[$i]; } } } } } /** * get an array of forms elements * * @param bool get elements recursively? * @return array array of {@link XoopsFormElement}s */ function &getElements($recurse = false){ if (!$recurse) { return $this->_elements; } else { $ret = array(); $count = count($this->_elements); for ($i = 0; $i _elements[$i] ) ) { if (!$this->_elements[$i]->isContainer()) { $ret[] =& $this->_elements[$i]; } else { $elements =& $this->_elements[$i]->getElements(true); $count2 = count($elements); for ($j = 0; $j getElements(true); $count = count($elements); for ($i = 0; $i getName(); } return $ret; } /** * get a reference to a {@link XoopsFormElement} object by its "name" * * @param string $name "name" attribute assigned to a {@link XoopsFormElement} * @return object reference to a {@link XoopsFormElement}, false if not found */ function &getElementByName($name){ $elements = $this->getElements(true); $count = count($elements); for ($i = 0; $i getName()) { return $elements[$i]; } } $elt = false; return $elt; } /** * Sets the "value" attribute of a form element * * @param string $name the "name" attribute of a form element * @param string $value the "value" attribute of a form element */ function setElementValue($name, $value){ $ele =& $this->getElementByName($name); if (is_object($ele) && method_exists($ele, 'setValue')) { $ele->setValue($value); } } /** * Sets the "value" attribute of form elements in a batch * * @param array $values array of name/value pairs to be assigned to form elements */ function setElementValues($values){ if (is_array($values) && !empty($values)) { // will not use getElementByName() for performance.. $elements =& $this->getElements(true); $count = count($elements); for ($i = 0; $i getName(); if ($name && isset($values[$name]) && method_exists($elements[$i], 'setValue')) { $elements[$i]->setValue($values[$name]); } } } } /** * Gets the "value" attribute of a form element * * @param string $name the "name" attribute of a form element * @return string the "value" attribute assigned to a form element, null if not set */ function getElementValue($name){ $ele =& $this->getElementByName($name); if (is_object($ele) && method_exists($ele, 'getValue')) { return $ele->getValue($value); } return; } /** * gets the "value" attribute of all form elements * * @return array array of name/value pairs assigned to form elements */ function getElementValues(){ // will not use getElementByName() for performance.. $elements =& $this->getElements(true); $count = count($elements); $values = array(); for ($i = 0; $i getName(); if ($name && method_exists($elements[$i], 'getValue')) { $values[$name] =& $elements[$i]->getValue(); } } return $values; } /** * set the extra attributes for the tag * * @param string $extra extra attributes for the tag */ function setExtra($extra){ $this->_extra = " ".$extra; } /** * get the extra attributes for the tag * * @return string */ function &getExtra(){ if (isset($this->_extra)) { return $this->_extra; } $extra = null; return $extra; } /** * make an element "required" * * @param object &$formElement reference to a {@link XoopsFormElement} */ function setRequired(&$formElement){ $this->_required[] =& $formElement; } /** * get an array of "required" form elements * * @return array array of {@link XoopsFormElement}s */ function &getRequired(){ return $this->_required; } /** * insert a break in the form * * This method is abstract. It must be overwritten in the child classes. * * @param string $extra extra information for the break * @abstract */ function insertBreak($extra = null){ } /** * returns renderered form * * This method is abstract. It must be overwritten in the child classes. * * @abstract */ function render(){ } /** * displays rendered form */ function display(){ echo $this->render(); } /** * Renders the Javascript function needed for client-side for validation * * Form elements that have been declared "required" and not set will prevent the form from being * submitted. Additionally, each element class may provide its own "renderValidationJS" method * that is supposed to return custom validation code for the element. * * The element validation code can assume that the JS "myform" variable points to the form, and must * execute return false if validation fails. * * A basic element validation method may contain something like this: * * function renderValidationJS() { * $name = $this->getName(); * return "if ( myform.{$name}.value != 'valid' ) { " . * "myform.{$name}.focus(); window.alert( '$name is invalid' ); return false;" . * " }"; * } * * * @param boolean $withtags Include the tags in the returned string */ function renderValidationJS( $withtags = true ) { $js = ""; if ( $withtags ) { $js .= "\n\n\ngetName(); $js .= "function xoopsFormValidate_{$formname}() { myform = window.document.$formname;\n"; // First, output code to check required elements $elements = $this->getRequired(); foreach ( $elements as $elt ) { $eltname = $elt->getName(); $eltcaption = trim( $elt->getCaption() ); $eltmsg = empty($eltcaption) ? sprintf( _FORM_ENTER, $eltname ) : sprintf( _FORM_ENTER, $eltcaption ); $eltmsg = str_replace('"', '\"', stripslashes( $eltmsg ) ); $js .= "if ( myform.{$eltname}.value == \"\" ) " . "{ window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }\n"; } // Now, handle custom validation code $elements = $this->getElements( true ); foreach ( $elements as $elt ) { if ( method_exists( $elt, 'renderValidationJS' ) ) { if ( $eltjs = $elt->renderValidationJS() ) { $js .= $eltjs . "\n"; } } } $js .= "return true;\n}\n"; if ( $withtags ) { $js .= "//-->\n\n"; } return $js; } /** * assign to smarty form template instead of displaying directly * * @param object &$tpl reference to a {@link Smarty} object * @see Smarty */ function assign(&$tpl){ $i = 0; $elements = array(); foreach ( $this->getElements() as $ele ) { $n = ($ele->getName() != "") ? $ele->getName() : $i; $elements[$n]['name'] = $ele->getName(); $elements[$n]['caption'] = $ele->getCaption(); $elements[$n]['body'] = $ele->render(); $elements[$n]['hidden'] = $ele->isHidden(); if ($ele->getDescription() != '') { $elements[$n]['description'] = $ele->getDescription(); } $i++; } $js = $this->renderValidationJS(); $tpl->assign($this->getName(), array('title' => $this->getTitle(), 'name' => $this->getName(), 'action' => $this->getAction(), 'method' => $this->getMethod(), 'extra' => 'onsubmit="return xoopsFormValidate_'.$this->getName().'();"'.$this->getExtra(), 'javascript' => $js, 'elements' => $elements)); } } ?>[/code][/quote]" />

Re: Youtube HotLink Gallery
by sermonindex on 2008/7/22 2:58:05

Do you have a version of this that works on the XOOPS 1.3x platform and not the XOOPS 2.0 platform?

Does anyone know of youtube modules that run on the older XOOPS platform?
Re: Youtube HotLink Gallery
by canuser on 2008/4/27 4:58:34

1. I want to change the font size of the title bar in the xtubestyle.css , but it doesn't work.

2. How to show the horizontal thumbs only 5 in 1 line and the rest on the second and third lines if it is over 10 thumbs?
Re: Youtube HotLink Gallery
by McDonald on 2008/3/29 16:16:46

For the video "Attack! Marketing - Song Airlines Promotion":

Video id-code: g2NtkysAWKo

Do not enter an image url for YouTube as mentioned.

Enter the correct publisher name: noelchandler

.::EDIT::.
If you enter another publisher name then mentioned on YouTube the link to the publishers' account on YouTube won't work.



Because the thumbnail doesn't show up you can see you've entered the wrong code!
Re: Youtube HotLink Gallery
by eventspeak on 2008/3/29 15:53:46

I down loaded the correct one but i will uninstall and re-download now.

I dont have any issues with the catagories just that the video does not play?
\
I confirmed the code is correct.


i willopen it up for you to see and test..

http://www.eventspeak.com/modules/xoopstube/



Check it out..
Re: Youtube HotLink Gallery
by McDonald on 2008/3/29 15:39:15

Appr. a week ago a small typo was corrected causing the categories not to show up.
So, if you downloaded XoopsTube before March 22 I suggest to download it again.

The video doesn't show up if you enter the wrong video id-code as showed in the submit forms (under the field for the id-code).

Who's Online

127 user(s) are online (100 user(s) are browsing Support Forums)


Members: 0


Guests: 127


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits