Zurück   klamm-Forum > Virtual World > Programmierung > Scripts & Software

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 12.03.2011, 20:55:01   #1 (permalink)
Losefaktor.de

ID: 260017
Lose-Remote

Reg: 12.10.2006
Beiträge: 1.756
muenchner1989 wird schon bald berühmt werden
Standard Notification - WBB 2.3.6; Fehler

Finde den Fehler.
Es geht um eine Notification die als "gelesen" makiert werden soll, im ersten code -> Funktioniert es.
Im zweiten -> Funktioniert es nicht, soll es aber!
Belohnung für den Script der Funktionier (Ich hab nun so ziemlich alles durch und kA warum es nicht klappt weil eig. kein fehler drin ist)
Code 1 (Originalcode, funktiniert mit mark_read)

PHP-Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
<?php
//Kommentare hier rein
?>

<div id='core_menu_mini_menu'>
  <?php
    
// Reverse the navigation order (they're floating right)
    
$count count($this->navigation);
    foreach( 
$this->navigation->getPages() as $item $item->setOrder(--$count);
  
?>
  <ul>
    <?php if( $this->viewer->getIdentity()) :?>
    <li id='core_menu_mini_menu_update'>
      <span onclick="toggleUpdatesPulldown(event, this, '4');" style="display: inline-block;" class="updates_pulldown">
        <div class="pulldown_contents_wrapper">
          <div class="pulldown_contents">
            <ul class="notifications_menu" id="notifications_menu">
              <div class="notifications_loading" id="notifications_loading">
                <img src='application/modules/Core/externals/images/loading.gif' style='float:left; margin-right: 5px;' />
                <?php echo $this->translate("Loading ..."?>
              </div>
            </ul>
          </div>
          <div class="pulldown_options">
            <?php echo $this->htmlLink(array('route' => 'default''module' => 'activity''controller' => 'notifications'),
               
$this->translate('View All Updates'),
               array(
'id' => 'notifications_viewall_link')) ?>
            <?php echo $this->htmlLink('javascript:void(0);'$this->translate('Mark All Read'), array(
              
'id' => 'notifications_markread_link',
            )) 
?>
          </div>
        </div>
        <a href="javascript:void(0);" id="updates_toggle" <?php if( $this->notificationCount ):?> class="new_updates"<?php endif;?>><?php echo $this->translate(array('%s Update''%s Updates'$this->notificationCount), $this->locale()->toNumber($this->notificationCount)) ?></a>
      </span>
    </li>
    <?php endif; ?>
    <?php foreach( $this->navigation as $item ): ?>
      <li><?php echo $this->htmlLink($item->getHref(), $this->translate($item->getLabel())) ?></li>
    <?php endforeach; ?>
    <?php if($this->search_check):?>
      <li id="global_search_form_container">
        <form id="global_search_form" action="<?php echo $this->url(array('controller' => 'search'), 'default'true?>" method="get">
          <input type='text' class='text suggested' name='query' id='global_search_field' size='20' maxlength='100' alt='<?php echo $this->translate('Search'?>' />
        </form>
      </li>
    <?php endif;?>
  </ul>
</div>


<script type='text/javascript'>
  var notificationUpdater;

  en4.core.runonce.add(function(){
    new OverText($('global_search_field'), {
      poll: true,
      pollInterval: 500,
      positionOptions: {
        position: ( en4.orientation == 'rtl' ? 'upperRight' : 'upperLeft' ),
        edge: ( en4.orientation == 'rtl' ? 'upperRight' : 'upperLeft' ),
        offset: {
          x: ( en4.orientation == 'rtl' ? -4 : 4 ),
          y: 2
        }
      }
    });

    if($('notifications_markread_link')){
      $('notifications_markread_link').addEvent('click', function() {
        //$('notifications_markread').setStyle('display', 'none');
        en4.activity.hideNotifications('<?php echo $this->string()->escapeJavascript($this->translate("0 Updates"));?>');
      });
    }

    <?php if ($this->updateSettings && $this->viewer->getIdentity()): ?>
    notificationUpdater = new NotificationUpdateHandler({
              'delay' : <?php echo $this->updateSettings;?>
            });
    notificationUpdater.start();
    window._notificationUpdater = notificationUpdater;
    <?php endif;?>
  });


  var toggleUpdatesPulldown = function(event, element, user_id) {
    if( element.className=='updates_pulldown' ) {
      element.className= 'updates_pulldown_active';
      showNotifications();
    } else {
      element.className='updates_pulldown';
    }
  }

  var showNotifications = function() {
    en4.activity.updateNotifications();
    new Request.HTML({
      'url' : en4.core.baseUrl + 'activity/notifications/pulldown',
      'data' : {
        'format' : 'html',
        'page' : 1
      },
      'onComplete' : function(responseTree, responseElements, responseHTML, responseJavaScript) {

        if(responseHTML){
          // hide loading icon
          if($('notifications_loading')) $('notifications_loading').setStyle('display', 'none');

          $('notifications_menu').innerHTML = responseHTML;
          $('notifications_menu').addEvent('click', function(event){
            event.stop(); //Prevents the browser from following the link.

            var current_link = event.target;
            var notification_li = $(current_link).getParent('li');

            // if this is true, then the user clicked on the li element itself
            if (notification_li.id == 'core_menu_mini_menu_update') notification_li = current_link;

            var forward_link;
            if(current_link.get('href')){
              forward_link = current_link.get('href');
            }
            else{
              forward_link = $(current_link).getElements('a:last-child').get('href');
            }

            if(notification_li.get('class')=='notifications_unread'){
              notification_li.removeClass('notifications_unread');
              en4.core.request.send(new Request.JSON({
                url : en4.core.baseUrl + 'activity/notifications/hide',
                data : {
                  format     : 'json',
                  'actionid' : notification_li.get('value')
                },
                onSuccess : window.location = forward_link
              }));
            }
            else window.location = forward_link;
          });
        }
        else $('notifications_loading').innerHTML = '<?php echo $this->string()->escapeJavascript($this->translate("You have no new updates."));?>';
      }
    }).send();
  };

</script>
Code Nummer 2 Modifiziert (Markieren als gelesen funktioniert NICHT, jedoch auch keine Fehlerausgabe o.ä.)

PHP-Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
<?php
//Kommentare hier hin
?>
<?php 
if( $this->viewer()->getIdentity() ): ?>

<div id='core_menu_mini_menu'>
  <?php
    
// Reverse the navigation order (they're floating right)
    
$count count($this->navigation);
    foreach( 
$this->navigation->getPages() as $item $item->setOrder(--$count);
  
?>
  <ul>
    <?php if( $this->viewer->getIdentity()) :?>
      <li id='core_menu_mini_menu_update'>
      <span onclick="toggleUpdatesPulldown(event, this, '4');" style="display: inline-block;" class="updates_pulldown">
    <div class="pulldown_contents_wrapper" style="right: 530px; margin-right: 45px; width: 250px; margin-top: 18px; padding-top: 1px; padding-left: 2px; padding-right: 2px;">
    <div class="pulldown_contents" style="margin-right: 15px;"> <ul class="notifications_menu" id="notifications_menu">
              <div class="notifications_loading" id="notifications_loading">
                <img src='application/modules/Core/externals/images/loading.gif' style='float:left; margin-right: 5px;' />
                <?php echo $this->translate("Loading ..."?>
              </div>
            </ul>
          </div>
          <div class="pulldown_options">
            <?php echo $this->htmlLink(array('route' => 'default''module' => 'activity''controller' => 'notifications'),
               
$this->translate('View All Updates'),
               array(
'id' => 'notifications_viewall_link')) ?>
            <?php echo $this->htmlLink('javascript:void(0);'$this->translate('Mark All Read'), array(
              
'id' => 'notifications_markread_link',
            )) 
?>
          </div>
        </div>
     <a href="javascript:void(0);" id="updates_toggle"><img style="position: absolute; float: left; margin-right: 5px; right: 807px; top: 7px;" src="application/themes/XXXX/images/notification.png"></a>
 <a href="javascript:void(0);" id="updates_toggle" style="position: absolute; top: -5px; padding: 1px; height: 13px; right: 810px; margin-top: 4px;"<?php if( $this->notificationCount ):?> class="new_updates" style="position: absolute; top: -10px; padding: 4px; height: 13px; right: 800px; margin-top: 9px;"<?php endif;?>><?php echo $this->translate(array($this->notificationCount), $this->locale()->toNumber($this->notificationCount)) ?></a>
 </span>
    </li>
    <?php foreach( $this->navigation as $item ): ?>
      <li><?php echo $this->htmlLink($item->getHref(), $this->translate($item->getLabel())) ?></li>
    <?php endforeach; ?>
    
     <li id='core_menu_mini_menu_account'>
      <span onclick="toggleAccountPulldown(event, this, '4');" style="display: inline-block;" class="account_pulldown">
       <div class="pulldown_contents_wrapper" style="padding-top: 2px; padding-left: 2px; padding-right: 2px; margin-top: 28px; left: 595px;">
         <div class="pulldown_contents">
            <ul class="notifications_menu" id="notifications_menu">
                                                    <li style="padding-top: 5px; height: 50px;">
  <div style="float:left;padding-left: 1px;"><?php echo $this->htmlLink($this->viewer()->getHref(), $this->itemPhoto($this->viewer(), 'thumb.icon')) ?> </div><div style="float:left;padding-left: 20px;"><p style="font-weight: bold; font-size: 13px; padding: 5px 0px 38px 0px;"><?php
    
if($this->viewer()->getTitle() == 'admin'){
        echo 
"<a href='" $this->url(array('module'=>'admin'), 'default'true) . "'>" $this->translate('Admin') . "</a>";
    }else{
     echo 
$this->htmlLink($this->viewer()->getHref(), $this->viewer()->getTitle());
    }
    
?> </div></a></li></p>
<ul>
<li>
                                                    <li><a href="./members/edit/profile" style="padding-top: 20px; padding-right:110px;">Edit My Profile</a></li></a>
                                                    <li><a href="./members/edit/photo" style="padding-top: 5px; padding-bottom: 5px; padding-right:110px;">Change Picture</a></li>
                                                    <li><a href="./members/settings/general" style="padding-top: 5px; padding-bottom: 5px; padding-right:110px;">Account&nbsp;Settings</a></li>
                                                    <li><a href="./members/settings/privacy" style="padding-top: 5px; padding-bottom: 5px; padding-right:110px;">Privacy Settings</a></li>
                                                    <li><a href="#" style="padding-top: 5px; padding-bottom: 5px; padding-right:160px;">Help</a></li>
                                                    <li><a href="<?php echo $this->url(array('controller' => 'logout'), 'default'true) ;?>" style="padding-top: 5px; padding-bottom: 3px; padding-right:155px;">Logout</a></li>

                                                </ul>

             </ul>
                  </div>
          </div>
        <a href="javascript:void(0);" id="account_toggle"><font color="#FFFFFF" style="text-transform: capitalize;">Account</font>&nbsp;&nbsp;<img src='application/themes/XXXX/images/arrow2.png'></a>
      </span>
    </li>
    <?php endif; ?>
    <?php if($this->search_check):?>
      <li id="global_search_form_container">
        <form id="global_search_form" action="<?php echo $this->url(array('controller' => 'search'), 'default'true?>" method="get">
          <input type='text' class='text suggested' name='query' id='global_search_field' size='20' maxlength='100' alt='<?php echo $this->translate('Search'?>' />
        </form>
      </li>
    <?php endif;?>
  </ul>
</div>

<div id="xxx"><ul><li><a href="./messages/inbox"><img style="position: absolute; float: left; margin-right: 5px; right: 833px; top: 17px;" src="application/themes/xxxx/images/message.png"></a>
</li><li><a href="./activity/notifications"><img style="position: absolute; float: left; margin-right: 5px; right: 859px; top: 17px;" src="application/themes/xxxxx/images/friend.png"></a>
</li><li><a href="./"><img style="position: absolute; float: left; margin-right: 5px; right: 880px; top: 13px;" src="application/themes/xxxx/images/logo.png"></a>
</li></ul>
</div>

<script type='text/javascript'>
  var notificationUpdater;

  en4.core.runonce.add(function(){
    new OverText($('global_search_field'), {
      poll: true,
      pollInterval: 500
    });

    if($('notifications_markread_link')){
      $('notifications_markread_link').addEvent('click', function() {
        //$('notifications_markread').setStyle('display', 'none');
       ('<?php echo $this->string()->escapeJavascript($this->translate(""));?>');
      });
    }
    
  <?php if ($this->updateSettings && $this->viewer->getIdentity()): ?>
    <?php endif;?>
  });

  var toggleUpdatesPulldown = function(event, element, user_id) {
    if( element.className=='updates_pulldown' ) {
      element.className= 'updates_pulldown_active';
      showNotifications();
    } else {
      element.className='updates_pulldown';
    }
  }

  var showNotifications = function() {
    new Request.HTML({
      'url' : en4.core.baseUrl + 'activity/notifications/pulldown',
      'data' : {
        'format' : 'html',
        'page' : 1
      },
      'onComplete' : function(responseTree, responseElements, responseHTML, responseJavaScript) {

        if(responseHTML){
          // hide loading icon
          if($('notifications_loading')) $('notifications_loading').setStyle('display', 'none');

          $('notifications_menu').innerHTML = responseHTML;
          $('notifications_menu').addEvent('click', function(event){
            event.stop(); //Prevents the browser from following the link.

            var current_link = event.target;
            var notification_li = $(current_link).getParent('li');

            // if this is true, then the user clicked on the li element itself
            if (notification_li.id == 'core_menu_mini_menu_update') notification_li = current_link;

            var forward_link;
            if(current_link.get('href')){
              forward_link = current_link.get('href');
            }
            else{
              forward_link = $(current_link).getElements('a:last-child').get('href');
            }

            if(notification_li.get('class')=='notifications_unread'){
              notification_li.removeClass('notifications_unread');
              en4.core.request.send(new Request.JSON({
                url : en4.core.baseUrl + 'activity/notifications/markread',
                data : {
                  format     : 'json',
                  'actionid' : notification_li.get('value')
                },
                onSuccess : window.location = forward_link
              }));
            }
            else window.location = forward_link;
          });
        }
        else $('notifications_loading').innerHTML = '<?php echo $this->string()->escapeJavascript($this->translate("You have no new updates."));?>';
      }
    }).send();
  };

</script>
 
 <script type='text/javascript'>
 
  var toggleAccountPulldown = function(event, element, user_id) {
    if( element.className=='account_pulldown' ) {
      element.className= 'account_pulldown_active';
      showNotifications();
    } else {
      element.className='account_pulldown';
    }
  }

</script>
<?php endif; ?>

<?php if( !$this->viewer->getIdentity()) :?>
 <div><a href="./"><img style="position: absolute; float: left; margin-right: 5px; right: 880px; top: 13px;" src="application/themes/XXXX/images/logo.png"></a>
</div>
<?php endif; ?>
Wer helfen kann bekommt Lose dafür; Danke.
Suche Projekt zum mitwirken. Interesse PN! | Erfahrungen erstrecken sich über Madmoo Entertainment (2008 Browsergame des Jahres) bis hinüber zur eigenen Firma - Gerne Loseseite ala FWX
muenchner1989 ist offline   Mit Zitat antworten
Antwort

Gesponsorte Links

Anzeige


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 
Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Edit-Fehler: "Jetzt Abstimmen" statt "Speichern" | Layout-Fehler Kesselchen Bug-Report 15 02.11.2009 20:28:23
Schnittstellen-Fehler am EF? (Returncode 1099) "unbekannter Fehler" mephi1982 Bug-Report 5 22.07.2009 03:31:58
(B) 300k Lose pro Fehler! Checkt meine Seite auf Fehler... Adiceltic Lose4Misc 14 12.11.2008 10:49:57
Fehler bei VMS 1.2 webace Lose4Scripts 12 30.09.2008 21:33:29


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:59:59 Uhr.