1
codefantom
Re: Banners won't display, PHP won't work in Blocks

Thanks for the reply and the advice Mamba. I just got the guide and will read over it all day tomorrow.



2
codefantom
Banners won't display, PHP won't work in Blocks
  • 2013/6/30 18:28

  • codefantom

  • Just popping in

  • Posts: 19

  • Since: 2013/6/19


First, I created by own banner. It was 500x200 originally but after Googling I changed it to 468x20. There was a posting that said this was the limit of the size banners xoops would accept. Can someone confirm that for me please?

Next I tried to get the banner to display but no results. I don't even know where it's suppose to display at. But the funny things it that the banner admin section is applying expressions even without seeing the banner.

Next I tried blocks. I found a posting for "Revolution Banner System" and so I pasted the appropriate code within the function.php within the root_directory/include/

function getbanner_from_id_banner($banner_id) { ###### Hack by www.stefanosilvestrini.com ###### global $xoopsConfig; $db =& Database::getInstance(); $bresult = $db->query("SELECT COUNT(*) FROM ".$db->prefix("banner")." WHERE bid = ". $banner_id); list ($numrows) = $db->fetchRow($bresult); if ( $numrows > 1 ) { $numrows = $numrows-1; mt_srand((double)microtime()*1000000); $bannum = mt_rand(0, $numrows); } else { $bannum = 0; } if ( $numrows > 0 ) { $bresult = $db->query("SELECT * FROM ".$db->prefix("banner")." WHERE bid = ". $banner_id, 1, $bannum); list ($bid, $cid, $imptotal, $impmade, $clicks, $imageurl, $clickurl, $date, $htmlbanner, $htmlcode) = $db->fetchRow($bresult); if ($xoopsConfig['my_ip'] == xoops_getenv('REMOTE_ADDR')) { // EMPTY } else { $db->queryF(sprintf("UPDATE %s SET impmade = impmade+1 WHERE bid = %u", $db->prefix("banner"), $bid)); } /* Check if this impression is the last one and print the banner */ if ( $imptotal == $impmade ) { $newid = $db->genId($db->prefix("bannerfinish")."_bid_seq"); $sql = sprintf("INSERT INTO %s (bid, cid, impressions, clicks, datestart, dateend) VALUES (%u, %u, %u, %u, %u, %u)", $db->prefix("bannerfinish"), $newid, $cid, $impmade, $clicks, $date, time()); $db->queryF($sql); $db->queryF(sprintf("DELETE FROM %s WHERE bid = %u", $db->prefix("banner"), $bid)); } if ($htmlbanner){ $bannerobject = $htmlcode; }else{ $bannerobject = '<div align="center"><a href="'.XOOPS_URL.'/banners.php?op=click&bid='.$bid.'" rel="nofollow">'; if (stristr($imageurl, '.swf')) { $bannerobject = $bannerobject .'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="468" height="60">' .'<param name="movie" value="'.$imageurl.'"></param>' .'<param name="quality" value="high"></param>' .'<embed src="'.$imageurl.'" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="468" height="60">' .'</embed>' .'</object>'; } else { $bannerobject = $bannerobject.'<img src="'.$imageurl.'" alt="" />'; }  $bannerobject = $bannerobject.'</a></div>'; } return $bannerobject; } }  function getbanner_from_id_client($client_id) { ###### Hack by www.stefanosilvestrini.com ###### global $xoopsConfig; $db =& Database::getInstance(); $bresult = $db->query("SELECT COUNT(*) FROM ".$db->prefix("banner")." WHERE cid = ". $client_id); list ($numrows) = $db->fetchRow($bresult); if ( $numrows > 1 ) { $numrows = $numrows-1; mt_srand((double)microtime()*1000000); $bannum = mt_rand(0, $numrows); } else { $bannum = 0; } if ( $numrows > 0 ) { $bresult = $db->query("SELECT * FROM ".$db->prefix("banner")." WHERE cid = ". $client_id ." ORDER BY rand()", 1, $bannum); list ($bid, $cid, $imptotal, $impmade, $clicks, $imageurl, $clickurl, $date, $htmlbanner, $htmlcode) = $db->fetchRow($bresult); if ($xoopsConfig['my_ip'] == xoops_getenv('REMOTE_ADDR')) { // EMPTY } else { $db->queryF(sprintf("UPDATE %s SET impmade = impmade+1 WHERE bid = %u", $db->prefix("banner"), $bid)); } /* Check if this impression is the last one and print the banner */ if ( $imptotal == $impmade ) { $newid = $db->genId($db->prefix("bannerfinish")."_bid_seq"); $sql = sprintf("INSERT INTO %s (bid, cid, impressions, clicks, datestart, dateend) VALUES (%u, %u, %u, %u, %u, %u)", $db->prefix("bannerfinish"), $newid, $cid, $impmade, $clicks, $date, time()); $db->queryF($sql); $db->queryF(sprintf("DELETE FROM %s WHERE bid = %u", $db->prefix("banner"), $bid)); } if ($htmlbanner){ $bannerobject = $htmlcode; }else{ $bannerobject = '<div align="center"><a href="'.XOOPS_URL.'/banners.php?op=click&bid='.$bid.'" rel="nofollow">'; if (stristr($imageurl, '.swf')) { $bannerobject = $bannerobject .'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="468" height="60">' .'<param name="movie" value="'.$imageurl.'"></param>' .'<param name="quality" value="high"></param>' .'<embed src="'.$imageurl.'" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="468" height="60">' .'</embed>' .'</object>'; } else { $bannerobject = $bannerobject.'<img src="'.$imageurl.'" alt="" />'; }  $bannerobject = $bannerobject.'</a></div>'; } return $bannerobject; } }


Now from this I am suppose to be able to post any of the below php code in the block to get the banner to show:

any random banner
echo xoops_getbanner();

based on banner ID
echo getbanner_from_id_banner(ID_BANNER);

a random client banner, based on client ID
echo getbanner_from_id_client(ID_CLIENT);


And I found 2 more:
echo
echo "<table border='0'>"; echo "<tr><td align='center'>"; echo xoops_getbanner(); echo "</td></tr>"; echo "</table>";

IF/ESLE
global $xoopsConfig; if ($xoopsConfig['banners'] == 1) {     //Display Banner     echo (xoops_getbanner()); } else {     return false; }


The posting Im reading are a little outdated from the current Xoops version. All other posts show and mention being able to select PHP for the block. My version doesn't give me that option.

1. I need help getting the banners to display or a reason why that aren't displaying or a thought as to where they are suppose to display by default.

2. I also need help finding out why php doesn't display in my blocks.

Any help is appreciated.



3
codefantom
[Solved]Where do I make cosmetic changes at
  • 2013/6/29 13:11

  • codefantom

  • Just popping in

  • Posts: 19

  • Since: 2013/6/19


Wow tarik,
I didn't know that the module was pulling the template files from the them.
That was the problem. You just solved 80 hours worth of attempts in 5mins.
Thanks for responding.



4
codefantom
Re: Where do I make cosmetic changes at
  • 2013/6/29 3:00

  • codefantom

  • Just popping in

  • Posts: 19

  • Since: 2013/6/19


There has to be another place to make changes besides the template files. I have deleted small sections from within these files because they don't fit the purpose of what my site is for and they still show up on the website.

I have gone into the admin maintenance section and deleted all the cache.

I have gone manual onto the server and deleted all the contents from all 3 cache directories inside the cache folder. (smarty_cache, smarty_compile, and xoops_cache)

I have deleted the cache from my browser as well.

And I have tested it on IE, Firefox and Chrome to see if there are any differences.

What am I missing? What is there left to change?

From wfdownloads_newlistindex.html I have deleted lines 3-13 (wfd_newlist_top) and that still appears on the newlist.php page.

I did the same for the recommend link on the wfdownloads_download.html
and wfdownloads_singlefile.html templates but when that still showed I just deleted the text from the main.php file inside the language directory. A dirty hack but I can't seem to solve this problem.

And another of my dirty hacks is on the wfdownload_index.html template. I deleted lines 31-48 to remove the 4 download images but again I ended up removing the text from the main.php and replaced the images with blank spacers.

I need a real solution to this problem if anyone can help.
ANY... suggestions or direction might lead me to a solution.



5
codefantom
Re: How do I change the Jquery image size in wfdownloads?
  • 2013/6/28 19:53

  • codefantom

  • Just popping in

  • Posts: 19

  • Since: 2013/6/19


I'm still working on this issue with no solution. The module is creating a thumbnail for the screenshot image so I turned this offer as a solution but it just enlarges the screenshot image to the original size of 1120x1648.

I found out that I'm using a thickbox jquery script but the thickbox.css offered no solutions either.

There was a similar problem on a prestashop forum but the solution was to check the original image size to make sure it was larger than 600x600 and that wasn't the problem.

It seems that the module is using the generated thumbnail for the screenshot image and the thickbox image as well. And that defeats the whole purpose of the script.

I'm trying to get the displayed screenshot to show as 300x450 and the thickbox image to display as 600x900.

Does anyone know how to change the dimensions of the thickbox image?

This is my last issue and I'm ready to launch my site.

Thanks in advance.



6
codefantom
Re: How do I find the module id?
  • 2013/6/28 4:48

  • codefantom

  • Just popping in

  • Posts: 19

  • Since: 2013/6/19


This below code is the script I'm trying to use. I put it in a block and it displays fine. But I can't get any search results to come up. When I use the advanced search with the same keyword I get search results fine. Which means this script is not pointing to the right module. I have systematically used 3-9 as my module id but none of them work. which can't be right.

Any more suggestions? This is one of my last two issues and I can publish the site.



<form action="<{$xoops_url}>/search.php" method="post" style="margin-bottom: 0px; margin-top: 0px;">
<
input class="srchinput" name="query" size="15" type="text" /> 
<
input name="action" type="hidden" value="results" /> 
<
input name="mids[]" type="hidden" value="5" /> 
<
input align="middle" name="Submit" src="<{$xoops_imageurl}>srchbut.gif" type="image" value="Search" />
</
form>



7
codefantom
Re: How do I find the module id?
  • 2013/6/28 2:24

  • codefantom

  • Just popping in

  • Posts: 19

  • Since: 2013/6/19


Here is a screenshot of my db.
Any help is appreciated.

Resized Image



8
codefantom
Re: How do I find the module id?
  • 2013/6/28 1:02

  • codefantom

  • Just popping in

  • Posts: 19

  • Since: 2013/6/19


I checked the database but none of my modules are assigned id's. I have a total of 7 modules installed, 2 are deactivated. (I also have 2 modules that im not including because they are bad installs that won't delete from the admin area) but in any case only one active module has a "mid." The rest are blank. Is there a way to fix this? Is it safe to assign them "mid's" from phpadmin? or do I need to do a fresh install of xoops?



9
codefantom
How do I find the module id?
  • 2013/6/27 22:28

  • codefantom

  • Just popping in

  • Posts: 19

  • Since: 2013/6/19


I just found the faq on how to create a from to search an individual module but it says that I need the module id. How do I go about finding this? Is it based on the order of the modules in the module admin section? Or is there a way to visual see it?



10
codefantom
How do I change the Jquery image size in wfdownloads?
  • 2013/6/27 22:07

  • codefantom

  • Just popping in

  • Posts: 19

  • Since: 2013/6/19


I am using wfdownloads and I noticed that the image screenshot and jquery image that loads when its clicked on are both the same size. When I change the size dimensions in the module admin then only the screenshot image changes. The jquery image doesn't. Where do I change the size of the jquery image? Or more clearly: How do I get it to load the full size picture that I upload?




TopTop
(1) 2 »



Login

Who's Online

249 user(s) are online (174 user(s) are browsing Support Forums)


Members: 0


Guests: 249


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits