Array 🥇 Foros Webmasters 🏅

Array 🥇 Foros Webmasters

Se encontraron 6 comentarios sobre Array en el Foro de Webnaranja

     Resetear
Puede repetir la búsqueda actual por Temas pulsando aquí
Autor Mensaje
  Arrays Multidimensionales en UNIX  Tema: Arrays Multidimensionales en UNIX  -   Lenguajes de Programación  Foro: Lenguajes de Programación
Envío Asunto:    Publicado: Avatar

Pues hoy he encontrado unos apuntes muy claros sobre arrays en PHP:
www.ignside.net/man/php/arrays.php
Explica de un modo claro y preciso, lo que es un array, un array asociativo y un array multidimensional.

Da gusto leerlo y se nota que no es una mera traducción.
  Como instalar en Foro PHPbb la opcion suscribirme a Foro  Tema: Como instalar en Foro PHPbb la opcion suscribirme a Foro  -   Portal DragonFlyCMS, CPGNuke  Foro: Portal DragonFlyCMS, CPGNuke
Envío Asunto:    Publicado: Avatar

...|| $mode == 'newtopic' ) {
$result = $db->sql_query('SELECT user_id FROM '.USERS_TABLE.' WHERE user_level<1');
$user_id_sql = '';
while ($row = $db->sql_fetchrow($result)) { $user_id_sql .= ', '.$row['user_id']; }

$sql = "SELECT u.user_id, u.user_email, u.user_lang
FROM ".FORUMS_WATCH_TABLE." tw, ".USERS_TABLE." u
WHERE tw.forum_id = $forum_id
AND tw.user_id NOT IN (".$userdata['user_id'].", ".ANONYMOUS.$user_id_sql.")
AND u.user_id = tw.user_id";
$result = $db->sql_query($sql);

$update_watched_sql = '';
$bcc_list_ary = array();

if ($row = $db->sql_fetchrow($result)) {
// Sixty second limit
set_time_limit(0);
do {
if ($row['user_email'] != '') {
$bcc_list_ary[$row['user_lang']][] = $row['user_email'];
}
$update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['user_id'] : $row['user_id'];
}
while ($row = $db->sql_fetchrow($result));

if (sizeof($bcc_list_ary)) {
include("includes/phpBB/emailer.php");
$emailer = new emailer();

$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word...
Leer más ...
  Instalar Plugins para URL amigables SH404SEF en Joomla  Tema: Instalar Plugins para URL amigables SH404SEF en Joomla  -   Portales Joomla!  Foro: Portales Joomla!
Envío Asunto:    Publicado: Avatar

...1.5 versions:

replace sef_ext/com_xxxxxx.php with your PlugIn file named e.g. com_comp123.php (If you don't have a PlugIn in this install leave the existing file but rename it to have the component name.)
replace meta_ext/com_xxxxxx.php with your PlugIn file named e.g. com_comp123.php (If you don't have a Meta file in this install leave the existing file but rename it to have the component name.)
Edit lines 15 & 16 in install.sef_ext_xxxxxx.php to have the component name e.g. 'comp123' and title e.g. 'Component 123'
Edit line 17 in install.sef_ext_xxxxxx.php if necessary to set the array values to 'false' if you do not want sef or meta installed. The installer will then skip these files.
Edit sef_ext_xxxxxx.xml and change the file names replacing xxxxxx with the component name (this must be the same as is in the component folder name)
Rename the various files by replacing 'xxxxxx' with the component name e.g. 'comp123'.
Test your modified installer package.
This sounds much more complicated than it actually is, making the changes takes just a couple of minutes.

When you upload and install the PlugIn installer it will look to make sure that the 'comp123' component...
Leer más ...
  Problemas con IP en web DragonflyCMS  Tema: Problemas con IP en web DragonflyCMS  -   Portal DragonFlyCMS, CPGNuke  Foro: Portal DragonFlyCMS, CPGNuke
Envío Asunto:    Publicado: Avatar

Bienvenido al foro.

Veo que tienes una versión de PHP inferior a la 5.2 (PHP Version 5.0.4) en esa versión los comandos inet_ntop y inet_pton de PHP estaban implementados, pero no funcionaban correctamente.

Supongo que no puedes actualizar tu servidor a una version de PHP posterior a la 5.2, asi que te voy a proponer darle un "cambiazo".

Vete a la linea 603 del Fichero "includes/cmsinit.inc" y encontrarás lo siguiente:

# IP Handling
function encode_ip($ip) {
if (PHPVERS >= 43) { $backtrace = debug_backtrace(); }
$backtrace = empty($backtrace) ? array('file' => 'unknown', 'line' => 0) : $backtrace[0];
trigger_error("DEPRECATED call to <a href=\"http://dragonflycms.org/$function\">$function</a>() by {$backtrace['file']} on line {$backtrace['line']}.", E_USER_WARNING);
return inet_pton($ip);
}

function ip2long32($ip, $unsigned=false) {
$ip = ip2long($ip);
if ($ip > 2147483647) { $ip -= 4294967296; } // pow(2,32)
if ($unsigned && $ip < 0) { $ip += 4294967296; }
return $ip;
}

function decode_ip($ip) {
global $db;
$ip = $db->unescape_binary($ip);
$l = strlen($ip);
if ($l == 5 || $l...
Leer más ...
  Arrays Multidimensionales en UNIX  Tema: Arrays Multidimensionales en UNIX  -   Lenguajes de Programación  Foro: Lenguajes de Programación
Envío Asunto:    Publicado: Avatar

Aunque en Unix se dice que no se pueden hacer Arrays Multidimensionales, hay una forma de simularlos.

El siguiente Script-ejemplo (array.sh) lo consigue:

Quote::

#!/usr/bin/ksh

##### Datos del array ####

Nombre[1]="Juan" ; Tel[1]="999888111"
Nombre[2]="Pepe" ; Tel[2]="999888222"
Nombre[3]="Jose" ; Tel[3]="999888321"
Nombre[4]="Adela" ; Tel[4]="999888444"

# Buscando el Telefono de Jose

buscar=Jose # buscar es la variable que me dice lo que busco

# la variable ${#Nombre[@]} nos da el numero de
# elementos en el array Nombre

cnt=1 # inicializamos el contador
# entramos en el buble

while [ $cnt -le ${#Nombre[@]} ];
do
if [ {${Nombre[$cnt]}} == {$buscar} ]
then
echo ${Nombre[$cnt]}" # "${Tel[$cnt]} ;
fi
cnt=$cnt+1;
done


El resultado obtenido por pantalla al ejecutar nuestro script (array.sh) en la shell de UNIX es

Quote::


Jose # 999888321

 
Página 1 de 1
Todas las horas son GMT + 1 Hora
Cambiar a: