Shows in ModCP and search but not on normal topics!
 
 
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> phpBB MODs -> Select Expand BBCodes
View previous topic :: View next topic  
Author Message
LoonyLuke
Apprentice
Apprentice


Joined: 13 Apr 2006
Posts: 9

PostPosted: Thu Apr 13, 2006 12:59 pm    Post subject: Shows in ModCP and search but not on normal topics! Reply with quote

Well, Thanks for the great mod, but....

It shows perfectly in ModCP and search but not at all on normal topics. I have a highly modified board and using Aphrodite by CA if that helps. I have a reasonably knowlage of PHP/etc. but can't see why it would work on ModCP and search but not on normal topics.

Any help greatly appreciated, Luke
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Thu Apr 13, 2006 1:25 pm    Post subject: Reply with quote

It looks like a conflict with another javascript. Do you have a link?
 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
LoonyLuke
Apprentice
Apprentice


Joined: 13 Apr 2006
Posts: 9

PostPosted: Thu Apr 13, 2006 1:32 pm    Post subject: Reply with quote

Sorry I don't have a link it is local Mad I shall check for other JS on the viewtopic.php page that is not on the others... 
Back to top
View user's profile Send private message
LoonyLuke
Apprentice
Apprentice


Joined: 13 Apr 2006
Posts: 9

PostPosted: Thu Apr 13, 2006 1:39 pm    Post subject: Reply with quote

Ok, have checked....
SEARCH.PHP PAGE
Code:
templates/ca_aphrodite/scripts.js

Code:
./includes/js_dom_toggle.js

Code:
./includes/js_dom_overview.js

Code:
./templates/select_expand_bbcodes.js


VIEWTOPIC.PHP EXTRAS TO ABOVE LIST
Code:
<a href="javascript:ShowHide('quick_reply','quick_reply2');"><img src="templates/ca_aphrodite/images/lang_english/quick_reply.gif" alt="Post a reply" /></a>

Code:
<a href="javascript:void(0);" onclick="window.open('http://www.postimage.org/index.php?mode=phpbb&tpl=' + 'ca_aphrodite' + '&forumurl=' + escape(document.location.href), '_imagehost', 'resizable=yes,width=500,height=400');return false;">Add image to post</a>

Code:
<script language="Javascript" type="text/javascript">
<!--
// remote scripting library
// (c) copyright 2005 modernmethod, inc
// edited by *=Matt=*
var I_REQUEST_TYPE    = "POST";
var I_DEBUG_MODE    = false;
var I_ADD_POLLS      = true;
var I_MOVE      = true;

function sajax_debug(text)
{
   if (I_DEBUG_MODE)
   {
      alert("RSD: " + text);
   }
}
function sajax_init_object()
{
    sajax_debug("sajax_init_object() called..")
    var A;
   try
   {
      A = new ActiveXObject("Msxml2.XMLHTTP");
   }
   catch (e)
   {
      try
      {
         A = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch (oc)
      {
         A = null;
      }
   }
   if(!A && typeof XMLHttpRequest != "undefined")
   {
      A = new XMLHttpRequest();
   }
   if (!A)
   {
      sajax_debug("Could not create connection object.");
   }
   return A;
}
function sajax_do_call(func_name, args)
{
   var i, x, n;
   var uri;
   var post_data;
   uri = "./ajax.php?f=1&t=12&sid=9189815d7c445de86aaf7df052ada960";
   if (I_REQUEST_TYPE == "GET")
   {
      if (uri.indexOf("?") == -1)
      {
         uri = uri + "?rs=" + escape(func_name);
      }
      else
      {
         uri = uri + "&rs=" + escape(func_name);
      }

      if( args[args.length-1] == "2")
      {
         for (i = 0; i < args.length-3; i++)
         {
            uri = uri + "&rsargs[]=" + escape(args[i]);
            uri = uri + "&rsrnd=" + new Date().getTime();
            post_data = null;
         }
      }
      else
      {
         for (i = 0; i < args.length-1; i++)
         {
            uri = uri + "&rsargs[]=" + escape(args[i]);
            uri = uri + "&rsrnd=" + new Date().getTime();
            post_data = null;
         }
      }
   }
   else
   {
      post_data = "rs=" + escape(func_name);

      if( args[args.length-1] == 2 )
      {
         for (i = 0; i < args.length-3; i++)
         {
            post_data = post_data + "&rsargs[]=" + escape(args[i]);
         }
      }
      else
      {
         for (i = 0; i < args.length-1; i++)
         {
            post_data = post_data + "&rsargs[]=" + escape(args[i]);
         }
      }
   }
   x = sajax_init_object();
   x.open(I_REQUEST_TYPE, uri, true);

   if (I_REQUEST_TYPE == "POST")
   {
      x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");
      x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   }

   x.onreadystatechange = function()
      {
         if (x.readyState != 4)
         {
            return;
         }

         sajax_debug("received " + x.responseText);

         var status;
         var data;
         status = x.responseText.charAt(0);
         data = x.responseText.substring(2);
         if (status == "-")
         {
            alert("Error: " + data);
            ih();
            return true;
         }
         else
         {
            if( args[args.length-1] == 2 )
            {
               args[args.length-3](data,args[args.length-2]);
            }
            else
            {
               args[args.length-1](data);
            }
         }
      }

   x.send(post_data);
   sajax_debug(func_name + " uri = " + uri + "/post = " + post_data);
   sajax_debug(func_name + " waiting..");
   delete x;
}
function x_edit_post_msg()
{
   sajax_do_call("edit_post_msg", x_edit_post_msg.arguments);
}

function x_edit_post_subject()
{
   sajax_do_call("edit_post_subject", x_edit_post_subject.arguments);
}

function x_post_delete()
{
   sajax_do_call("post_delete", x_post_delete.arguments);
}

function x_delete_topic()
{
   sajax_do_call("delete_topic", x_delete_topic.arguments);
}

function x_move_topic()
{
   sajax_do_call("move_topic", x_move_topic.arguments);
}

function x_move()
{
   sajax_do_call("move", x_move.arguments);
}

function x_move_build()
{
   sajax_do_call("move_build", x_move_build.arguments);
}

function x_lock_unlock_topic()
{
   sajax_do_call("lock_unlock_topic", x_lock_unlock_topic.arguments);
}

function x_lock_topic()
{
   sajax_do_call("lock_topic", x_lock_topic.arguments);
}

function x_get_editor()
{
   sajax_do_call("get_editor", x_get_editor.arguments);
}

function x_edit_post_msg_update()
{
   sajax_do_call("edit_post_msg_update", x_edit_post_msg_update.arguments);
}

function x_post_ip()
{
   sajax_do_call("post_ip", x_post_ip.arguments);
}

function x_watch_topic()
{
   sajax_do_call("watch_topic", x_watch_topic.arguments);
}

function x_post_menu()
{
   sajax_do_call("post_menu", x_post_menu.arguments);
}

-->
</script>
<script language="javascript1.2" src="includes/AJAXed_config.php"></script>
<script language="javascript1.2" src="includes/AJAXed_func.js"></script>


Not sure what out of that could be doing it. Could javascript:void(0) be doing it? Do you wish to see the content of includes/AJAXed_config.php and includes/AJAXed_func.js?

Thanks for your help Wink
 
Back to top
View user's profile Send private message
LoonyLuke
Apprentice
Apprentice


Joined: 13 Apr 2006
Posts: 9

PostPosted: Thu Apr 13, 2006 1:43 pm    Post subject: Reply with quote

Sorry cannot edit my post above... the very last code box with the AJAXed stuff in it was added after first attempt to install this mod, so was not what (orignally, at least) stopped it working.

Luke Crying or Very sad
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Thu Apr 13, 2006 1:49 pm    Post subject: Reply with quote

Try to see if there is any javascript error. If so, post the message here, better if you could try to identify which line it happens.

Another thing to check: is there any onload="stuff" in the body tag?

It's hard to tell by just looking at the code... if there was a link or if the code was shorter.

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
LoonyLuke
Apprentice
Apprentice


Joined: 13 Apr 2006
Posts: 9

PostPosted: Thu Apr 13, 2006 1:56 pm    Post subject: Reply with quote

Both files do have this:
Code:
<body onload="PreloadFlag = true;">


Yes, I have some errors (that apply Smile ):
Code:
Warning: anonymous function does not always return a value
Source File: http://localhost/Quezza/1-0_Development/templates/select_expand_bbcodes.js
Line: 147, Column: 13
Source Code:
   return false;


Code:
Error: syntax error
Source File: http://localhost/Quezza/1-0_Development/viewtopic.php?p=17#17
Line: 472
Source Code:
&nbsp;&nbsp;&nbsp;&nbsp;var id = 'SXBB' + (1000 + Math.floor(Math.random() * 5000));&nbsp;&nbsp;&nbsp;&nbsp;SXBB[id] = new _SXBB(id);&nbsp;&nbsp;&nbsp;&nbsp;SXBB[id].T['select'] = 'Select';&nbsp;&nbsp;&nbsp;&nbsp;SXBB[id].T['expand'] = 'Expand';&nbsp;&nbs


Code:
Error: syntax error
Source File: http://localhost/Quezza/1-0_Development/viewtopic.php?p=17#17
Line: 476
Source Code:
&nbsp;&nbsp;&nbsp;&nbsp;SXBB[id].writeDiv();


Code:
Error: syntax error
Source File: http://localhost/Quezza/1-0_Development/viewtopic.php?p=17#17
Line: 516
Source Code:
&nbsp;&nbsp;&nbsp;&nbsp;document.write('</div>');


Those were the errors that FireFox's Developer Toolbar picked up

Thanks
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Thu Apr 13, 2006 3:26 pm    Post subject: Reply with quote

Ugh! All those &nbsp; symbols look weird. Those are HTML entities that shouldn't be present within a javascript block. Do you see them when viewing the source of the viewtopic page? If so, try to identify which MOD is doing that and report to its author.

Second, try removing the onload="PreloadFlag = true;" part of the body tag. This method shortcircuits any other onload event handler installed via javascript. This is vital for SXBB. If removing that breaks anything else, too bad. IMO, it has to be reported to the author of the affected code.

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
LoonyLuke
Apprentice
Apprentice


Joined: 13 Apr 2006
Posts: 9

PostPosted: Thu Apr 13, 2006 3:36 pm    Post subject: Reply with quote

Removing the onload="PreloadFlag = true;" made no difference. I shall try to find out and remove the &nbsp; and report back here.

Thanks for your support, Luke
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Thu Apr 13, 2006 3:42 pm    Post subject: Reply with quote

Maybe those &nbsp; symbols are being inserted by another BBCode or another MOD that affects how posts are displayed or even maybe something part of the template class?

It is something that is replacing leading tabs in posted messages with hardcoded spaces.

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
LoonyLuke
Apprentice
Apprentice


Joined: 13 Apr 2006
Posts: 9

PostPosted: Thu Apr 13, 2006 3:47 pm    Post subject: Reply with quote

I have this code:
Code:
   for ($i = 0; $i < $match_count; $i++)
   {
      $before_replace = $matches[1][$i];
      $after_replace = $matches[1][$i];

      // Replace 2 spaces with "&nbsp; " so non-tabbed code indents without making huge long lines.
      $after_replace = str_replace("  ", "&nbsp; ", $after_replace);
      // now Replace 2 spaces with " &nbsp;" to catch odd #s of spaces.
      $after_replace = str_replace("  ", " &nbsp;", $after_replace);

      // Replace tabs with "&nbsp; &nbsp;" so tabbed code indents sorta right without making huge long lines.
      $after_replace = str_replace("\t", "&nbsp; &nbsp;", $after_replace);

      // now Replace space occurring at the beginning of a line
      $after_replace = preg_replace("/^ {1}/m", '&nbsp;', $after_replace);

      $str_to_match = "[code:1:$uid]" . $before_replace . "[/code:1:$uid]";

      $replacement = $code_start_html;
      $replacement .= $after_replace;
      $replacement .= $code_end_html;

      $text = str_replace($str_to_match, $replacement, $text);
   }

Which was added for some reason, can I just remove the tabs from you bbcode.tpl code?
 
Back to top
View user's profile Send private message
LoonyLuke
Apprentice
Apprentice


Joined: 13 Apr 2006
Posts: 9

PostPosted: Thu Apr 13, 2006 3:51 pm    Post subject: Reply with quote

Wicked! I just removed the tab from the begining of the lines and it sorted it Smile Thanks so much for your help today Smile I can even leave the onload in the body tag Wink

Thanks, Luke
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Thu Apr 13, 2006 3:53 pm    Post subject: Reply with quote

Try removing the leading tabs. Do not replace them with spaces because that code will probably touch that too. It seems it also replaces 2 consecutive spaces.

Though please, try reporting to the author of that MOD. If (s)he knows, good when other find the same problem reported to him/her and b) maybe (s)he can think of a workaround.

Then... if SXBB doesn't work yet, try removing that piece of code from the body tag.


edited: Great then Smile ...ah, concurrent posting. Wink

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
LoonyLuke
Apprentice
Apprentice


Joined: 13 Apr 2006
Posts: 9

PostPosted: Thu Apr 13, 2006 3:56 pm    Post subject: Reply with quote

OK, Shall workout which mod did that code and contact them about it. Thanks again for your help Smile 
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> phpBB MODs -> Select Expand BBCodes All times are GMT + 1 Hour
 
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum