Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
  #1  
Old 08-21-2011, 10:55 PM
MayerZwo MayerZwo is offline
 
Join Date: Aug 2009
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Include Html as Header

Hello

Im trying to include this as Header at my vB4.1.5.
I used this Tutorial but I?m getting two Errors:

[function.file]: failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in [path]/global.php(29) : eval()'d code (Zeile 1)

Warnung: implode() [function.implode]: Invalid arguments passed in [path]/global.php(29) : eval()'d code (Zeile 1)

Thanks for any Help.
Best Regards
Reply With Quote
  #2  
Old 08-23-2011, 03:17 PM
MayerZwo MayerZwo is offline
 
Join Date: Aug 2009
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, Error Messages are gone now, but the Header doesn`t show up.

What did I do so far:
  1. I made a Plugin called includedhtml with Hook global_start: $includedhtml = implode('', file('http://www.path/to/my_header.html'));
  2. I put {vb:raw includedhtml} at Top of the Header-Template.
I would be glad if someone could help me.
I simply just wanna show the following Header-Code at Top of the Site.

Header Code is:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en-us">
<head>
  
  <script type="text/javascript" src="http://www.terrarienbilder.com/parallax/jquery-1.2.6.min.js"></script>
  <script type="text/javascript" src="http://www.terrarienbilder.com/parallax/jquery.jparallax.js"></script>
  <link rel="stylesheet" type="text/css" media="screen" href="http://www.terrarienbilder.com/parallax/style.css">

  <script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#parallax').jparallax({});
});
  </script>
  
  

</head>

<body>

<hr size="1">
<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">

  <tbody>

    <tr>

      <td style="width: 24%;"></td>

      <td style="width: 802px; text-align: center; vertical-align: middle;">
      <div style="border: 1px solid ; position: relative; width: 800px; height: 150px;" id="parallax">

      <div style="width: 800px; height: 150px;"><img alt="" src="http://www.terrarienbilder.com/parallax/bg_1.png"></div>

      <div style="width: 990px; height: 180px;">
      <img style="position: absolute; top: -40px; left: 650px;" alt="" src="http://www.terrarienbilder.com/parallax/palm_1.png"></div>

      </div>

      </td>

      <td style="width: 24%;"></td>

    </tr>

  </tbody>
</table>

<hr size="1">
</body>
</html>
Best regards
Reply With Quote
  #3  
Old 08-23-2011, 03:30 PM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what does the file function do and are you sure it returns an array?

I'm not sure if you actually know what you're doing with the implode and file functions there, otherwise you'd know what causes this, apparently file does not return an array, which implode expects.
Also: URL path instead of absolute path? weird
Reply With Quote
  #4  
Old 08-25-2011, 02:21 PM
MayerZwo MayerZwo is offline
 
Join Date: Aug 2009
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I managed it to show the Header.
I simply added the Code directly into the Header-Template.

Well, one Problem stays.
The Header has an jparallax-Effect. As soon as I put the following Code into Header-Template I can`t save the Template. So I`m not able to get the jparallax working.
Code:
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#parallax').jparallax({});
});
  </script>
Has anybody an Idea what`s wrong or where I should put this Code in ?
I tried headinclude-Template, doesn`t work.

Thanks in advance
MayerZwo
Reply With Quote
  #5  
Old 08-25-2011, 02:49 PM
nhawk nhawk is offline
 
Join Date: Jan 2011
Posts: 1,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Create a plugin that uses the 'parse_templates' hook.

Place this code in the plugin..
Code:
$template_hook['headinclude_javascript'] .= ' <script type="text/javascript" src="http://www.terrarienbilder.com/parallax/jquery-1.2.6.min.js"></script>
  <script type="text/javascript" src="http://www.terrarienbilder.com/parallax/jquery.jparallax.js"></script>
  <link rel="stylesheet" type="text/css" media="screen" href="http://www.terrarienbilder.com/parallax/style.css">
<script type="text/javascript">
jQuery(document).ready(function(){';
$template_hook['headinclude_javascript'] .= "jQuery('#parallax').jparallax({});
});
  </script>";
And remove any of the script information you might have pasted into the header template. Just leave this there...

HTML Code:
<hr size="1">
<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">

  <tbody>

    <tr>

      <td style="width: 24%;"></td>

      <td style="width: 802px; text-align: center; vertical-align: middle;">
      <div style="border: 1px solid ; position: relative; width: 800px; height: 150px;" id="parallax">

      <div style="width: 800px; height: 150px;"><img alt="" src="http://www.terrarienbilder.com/parallax/bg_1.png"></div>

      <div style="width: 990px; height: 180px;">
      <img style="position: absolute; top: -40px; left: 650px;" alt="" src="http://www.terrarienbilder.com/parallax/palm_1.png"></div>

      </div>

      </td>

      <td style="width: 24%;"></td>

    </tr>

  </tbody>
</table>

<hr size="1">
Reply With Quote
Благодарность от:
MayerZwo
  #6  
Old 08-25-2011, 03:53 PM
MayerZwo MayerZwo is offline
 
Join Date: Aug 2009
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Amazing nhawk !
Works Perfect. Thanks for helping an Noob. :up:

Best regards
MayerZwo
Reply With Quote
Благодарность от:
nhawk
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:56 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.10363 seconds
  • Memory Usage 2,210KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (2)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete