Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP][Script] Połączenie dwóch skryptów.
martinikiss
post 23.05.2018, 19:16:06
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 28.01.2013

Ostrzeżenie: (0%)
-----


Cześć! Potrzebuję pomocy z połączeniem dwóch skryptów. Jeden wyświetla slider bez tekstu, drugi wyświetla slideshow z tekstem a ja chciałbym by ten pierwszy również wyświetlał tekst jaki bierze z biblioteki czyli title i description. Zlokalizowałem te dwa skrypty. Może ktoś podsunie rozwiązanie lub nakieruje jak to zrobić?

  1.  
  2. <div id="splash" class="bleed_{{ settings.splash_bleed }} spin_{{ settings.show_content_load_spin }}">
  3.  
  4. <koken:if true="settings.show_content_load_spin">
  5. <koken:if data="settings.spin_style" equals="halfcirc"><div class="spinner_pos"><div class="spinner"></div></div></koken:if>
  6. </koken:if>
  7.  
  8. <koken:pulse jsvar="splashy" group="lens_splash" width="100%" height="100%" crop="fill" link_to="advance" speed="5" transition_duration="0.8" fallbacktext="No featured content found. Assign some in the Library." />
  9.  
  10. </div>
  11.  
  12. <script>
  13. splashy.on('waiting', function(e) {
  14. var settings = {{ settings.to_json fields="show_content_load_spin,spin_style" }};
  15. if (settings.show_content_load_spin) {
  16. if (e) {
  17. if (settings.spin_style == "halfcirc") {
  18. $('.spinner_pos').fadeIn();
  19. } else {
  20. $('#splash').addClass('show_flower');
  21. }
  22. } else {
  23. if (settings.spin_style == "halfcirc") {
  24. $('.spinner_pos').fadeOut();
  25. } else {
  26. $('#splash').removeClass('show_flower');
  27. }
  28.  
  29.  
  30.  
  31.  
  32. }
  33. }
  34. });
  35. </script>


  1. function koken_slideshow($attr)
  2. {
  3. $rand = 'p' . md5(uniqid(function_exists('mt_rand') ? mt_rand() : rand(), true));
  4.  
  5. if (!isset($attr['link_to']))
  6. {
  7. $attr['link_to'] = 'default';
  8. }
  9.  
  10. $attr['link_to'] = 'link_to="' . $attr['link_to'] . '"';
  11.  
  12. if (isset($attr['content']))
  13. {
  14. $path = '/content/' . $attr['content'];
  15. }
  16. else if (isset($attr['album']))
  17. {
  18. $path = '/albums/' . $attr['album'] . '/content';
  19. }
  20.  
  21. $text = '';
  22. if (isset($attr['caption']) && $attr['caption'] !== 'none')
  23. {
  24. $text .= '<figcaption id="' . $rand .'_text" class="k-content-text">';s
  25. if ($attr['caption'] !== 'caption')
  26. {
  27. $text .= '<span class="k-content-title"> </span>';
  28. }
  29. if ($attr['caption'] !== 'title')
  30. {
  31. $text .= '<span class="k-content-caption"> </span>';
  32. }
  33. $text .= '</figcaption>';
  34. $text .= <<<JS
  35. <script>
  36. $rand.on( 'transitionstart', function(e) {
  37. var title = $('#{$rand}_text').find('.k-content-title'),
  38. caption = $('#{$rand}_text').find('.k-content-caption');
  39.  
  40. if (title) {
  41. title.text(e.data.title || e.data.filename);
  42. }
  43.  
  44. if (caption) {
  45. caption.html(e.data.caption);
  46. }
  47. });
  48. </script>
  49. JS;
  50. }
  51.  
  52. return <<<HTML
  53. <figure class="k-content-embed">
  54. <div class="k-content">
  55. <koken:pulse jsvar="$rand" data_from_url="$path" size="auto" {$attr['link_to']} group="essays" />
  56. </div>
  57.  
  58.  
  59.  
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 28.03.2024 - 15:55