إنضمامك إلي منتديات استراحات زايد يحقق لك معرفة كل ماهو جديد في عالم الانترنت ...

انضم الينا
استراحات زايد الصفحة الرئيسية

         :: المحامية رباب المعبي : حكم لصالح موكلنا بأحقيتة للمبالغ محل الدعوى (آخر رد :حوااااء)       :: برامج الرشاقة السعيدة (آخر رد :دارين الدوسري)       :: تفسير الحلم بمعدات الصيد (آخر رد :نوران نور)       :: تفسير حلم انجاب ولد للمتزوجه (آخر رد :نوران نور)       :: تفسير حلم رؤية المطر (آخر رد :نوران نور)       :: تفسير حلم حادث دهس (آخر رد :نوران نور)       :: رؤيا اكل الحلوى في المنام (آخر رد :نوران نور)       :: تفسير حلم الخنفساء السوداء في المنزل (آخر رد :نوران نور)       :: شنط قماش هاند ميد| تحف فنية تعكس الإبداع والأناقة الشخصية (آخر رد :konouz2017)       :: افضل فني نجار بالرياض 20% خصم (آخر رد :layansherief)      

إضافة رد
 
LinkBack أدوات الموضوع انواع عرض الموضوع
  #1  
قديم 09-14-2009, 08:20 AM
عضو ماسي
بيانات محروم.كوم
 رقم العضوية : 503
 تاريخ التسجيل : Dec 2007
الجنس : female
علم الدوله :
 المشاركات : 2,100,612
عدد الـنقاط :3341
 تقييم المستوى : 2139

Hi guys,

the problems associated with swf and flash delivery seem to be numerous and I have been searching and asking on vb.org and at openx for some time to no avail.

I thought I might beg your indulgence and try to get my head around the problem by coming back to the source so to speak.

I will make every effort to clearly describe my approach and avoid any unnecessary conflict between the openx offering and vB supported/unsupported contexts.

For reference I have been pursuing a solution in these threads:
http://www.vbulletin.org/forum/showthread.php?t=219301
http://www.vbulletin.org/forum/showthread.php?t=217254
http://forum.openx.org/index.php?sho...=503428016&hl=

The problem is simple:
1) I have modified some code that uses openx's localmode to invoke an advertising campaign, delivering a banner to the header thus:
Template: ad_header_logo
Code:

The ad tag is what calls the banner in:
Ad tag callback in template_compile
Code:
if (!function_exists('_tag_callback'))
{
/**
* Callback-function for process_template_tag() which "parses" arguments and returns PHP code for eval
*
* @param string Options/arguments of tag
* @param string Name of function to call
* @param array Associative array of argument names and default values
*
* @return string
*/
function _tag_callback($options, $functionhandle, $arglist)
{
$options = stripslashes($options);
trim($options);
trim($functionhandle);

if (!function_exists('replace_template_variables'))
{
require_once(DIR . '/includes/functions_misc.php');
}

$param = array();
if (is_array($arglist))
{
reset($arglist);
foreach ($arglist AS $key => $val)
{
if (preg_match('#'.$key.'=([\\\]["\'])(.*?)\1#', $options, $matches))
{
$param[] = $matches[2];
}
else
{
// default argument
$param[] = $val;
}
}
}

foreach ($param AS $argument)
{
if ($return == '')
{
$return = '" . ' . $functionhandle . '(';
}
else
{
$return .= ', ';
}
// Surround variables with {} - not failsafe, but should do the job in most cases
$argument = preg_replace('#\$([a-z0-9_>-]+)((\[\'.*?\'\])+)#i', '{$\\1\\2}', $argument);
// {{$foo}} --> {$foo}
$argument = preg_replace('#(\{+)\$(.*?)(\}+)#i', '{$\\2}', $argument);

// Replace legacy variable names in templates with their modern equivalents
$argument = replace_template_variables($argument, true);

$return .= '"' . $argument . '"';
}
$return .= ') . "';
return $return;
}
}

if (!function_exists('process_template_tag'))
{
/**
* Processes user-defined tags into myfunction() PHP code for eval
*
* @param string Title of tag
* @param string Un-parsed template HTML
* @param string Name of function to call
* @param array Associative array of argument names and default values, order must be the same as for the function specified previously
*
* @return string
*/
function process_template_tag($tagname, $text, $functionhandle='', $arglist)
{
if ($functionhandle == '')
{
// No function specified - remove tag
return preg_replace("#|#si", '', $text);

}
else
{
return preg_replace("##sie", "_tag_callback('\\3', \$functionhandle, \$arglist)", $text);
}
}
}

$template = process_template_tag('ad', $template, 'view_ad', array('what' => '', 'clientid' => 0, 'target' => '', 'source' => '', 'withtext' => 0) );
This combines with the view ad function in init_startup
Code:
if (!function_exists('view_ad'))
{
/**
* Calls view_raw function from phpAdsNew either locally or via xml-rpc to get HTML advertisement code, see phpAdsNew for infos.
*
* @param string Zone name (zone:x) or keywords (keyword1|keyword2|...)
* @param integer Client-ID
* @param string Target
* @param string Source
* @param integer Withtext
*
* @return string
*/
function view_ad($what, $clientid = 0, $target = '', $source = '', $withtext = 0)
{
global $vbulletin;
static $panpath;

if (!$panpath)
{
trim($vbulletin->options['panpath']);
$panpath = @parse_url($vbulletin->options['panpath']);
}

// Calculate an identifier for the requested ad - this could be used to cache banners retrieved via xmlrpc in future versions
$adid = sprintf('%u', crc32($what . $clientid . $target . $source . $withtext));

if ($vbulletion->options['addtemplatename'] or $vbulletin->config['Misc']['debug'])
{
// Be verbose
$adcomment = 'id="' . $adid . '" what="' . htmlspecialchars($what) . '" clientid="' . htmlspecialchars($clientid)
. '" target="' . htmlspecialchars($target) . '" source="' . htmlspecialchars($source)
. '" withtext="' . htmlspecialchars($withtext) . '"';
}
else
{
$adcomment = $adid;
}

if ($vbulletin->options['panpath'] == '')
{
// Path to phpAdsNew is empty - disable ads
return "";
}
elseif (strtolower($panpath['scheme']) == 'http')
{
// get banner from phpAdsNew via xml-rpc
/*
// ATTN:
// In phpAdsNew 2.0.6 (and maybe earlier versions) is a tiny bug which prevents xml-rpc from working cleanly.
//
// Patch:
// --- phpAdsNew/misc/samples/xmlrpc/php/lib-xmlrpc.inc.php.orig Tue Aug 16 10:51:26 2005
// +++ phpAdsNew/misc/samples/xmlrpc/php/lib-xmlrpc.inc.php Thu Oct 27 1726 2005
// @@ -76,6 +76,7 @@
// global $xmlrpcStruct;
//
// global $xmlrpcTypes;
// + global $xmlrpc_valid_parents;

// global $xmlEntities;
// global $xmlrpcerr;
// global $xmlrpcstr;
//
// See https://sourceforge.net/tracker/?fun...group_id=11386 for details.
*/

global $xmlrpcbanner, $phpAds_remoteInfo;
require_once(DIR . '/includes/lib-xmlrpc-class.inc.php'); // see misc/samples/xmlrpc/php/ directory of your phpAdsNew installation

if (!$xmlrpcbanner)
{
$xmlrpcbanner = new phpAds_XmlRpc($panpath['host'], $panpath['path'], (intval($panpath['port']) > 0 ? $panpath['port'] : 80));
}

$ad = $xmlrpcbanner->view_raw($what, $clientid, $target, $source, $withtext);

return "{$ad['html']}";
}
else
{
// get banner via direct invocation of phpAdsNew
// this is basically taken from the invocationcode generated by phpAdsNew - it does its own checks to prevent multiple inclusion

global $phpAds_context;

if (@require($vbulletin->options['panpath'] . (strstr($vbulletin->options['panpath'] , '/phpadsnew.inc.php') ? '' : '/phpadsnew.inc.php' )))
{
if (!isset($phpAds_context))
{
$phpAds_context = array();
}

$ad = view_raw($what, $clientid, $target, $source, $withtext, $phpAds_context);

if ($vbulletin->options['panbandupes'])
{
// Remember bannerid to prevent showing banner multiple times on same page
$phpAds_context[] = array('!=' => 'bannerid:'.$ad['bannerid']);
}
OA_setTimeZone('Australia/Sydney');
return "{$ad['html']}";
}
}
}
}
to pull the desired ad.

So... Why is it that the localmode invocation that gets generated when an swf banner is delivered does not display?
The very same invocation code when placed in its own php script delivers and displays correctly - this link illustrates the following code:
http://www.archeli.com.au/forums/localmode.php

PHP Code:


Can anyone see what I need to do to make the ad call back and view plugins overcome the limitation that exists as they are implemented in the vB ad header context. gif and jpg etc all work perfectly - only swf fail and fall back to the static content.
There must be a fundamental wrapper or declaration statement/condition that I need to add to allow swf to be embedded properly.

I would very much appreciate any help with this since I have been searching and researching in vain for some time. I am sure it is something rather trivial that I am missing - when I get it sorted I will write up the process at vb.org so others can benefit.

Please understand that I know this is not core support for vB and I have tried at .org to no avail, openx point to vb since the code works in its own script. given that there are so many questions around flash in headers I thought I might ask. I understand if you won't address the issue however since this is out of scope.

Will
__DEFINE_LIKE_SHARE__
رد مع اقتباس
إضافة رد

مواقع النشر (المفضلة)


تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة
Trackbacks are متاحة
Pingbacks are متاحة
Refbacks are متاحة


المواضيع المتشابهه
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
vB4 Remove space between header and main body? محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 06-19-2010 01:30 AM
Problem With OpenX محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 04-02-2010 02:30 AM
Forum main css problem محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 01-17-2010 11:00 AM
Header Resizing to match main table! (noob) محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 08-26-2009 10:50 PM
Flash header in template محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 05-03-2009 07:00 PM


الساعة الآن 04:23 AM


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.5.2 TranZ By Almuhajir

RSS RSS 2.0 XML MAP HTML