Recent Topics

1 Mar 21, 2007 14:57    

My b2evolution Version: 1.9.x

You guys really are great at answering questions. I've been learning so much!

I'm working on a skin for mobile devices and have a few questions. When _feedback.php generates a page with the comment form, it adds in some Javascript. I've looked all through _feedback.php, and I can't find where it is being called into play. The problem with this is that my (and others') mobile devices don't support Javascript, which results in some visible jibberish. The biggest problem is:

<script type="text/javascript">
							var nb_dynamicSelects = 0;
							var tab_dynamicSelects = Array();
						</script>

In the source code, which ends up displaying:

var nb_dynamicSelects = 0; var tab_dynamicSelects = Array();

On the page when accessed with my mobile device. I'm not very good with javascript so I'm not really sure what these scripts are doing, but I'm pretty sure they aren't essential and I would like to remove them for my mobile-accessible skin.

The other one I'd like to remove is:

<script type="text/javascript">
				//<![CDATA[
				if( typeof addEvent == "function" && typeof init_dynamicSelect == "function" )
				{
					addEvent( window, "load", init_dynamicSelect, false );
					
				}
				
				//]]>
			</script>

The second thing. When people post comments, it attaches [visitor] to the end of their names. This would be fine, except that I don't allow user registrations on my site, so everyone but me is a visitor (and I wouldn't comment on my own blog). This also poses a much bigger problem on mobile devices since it takes up valuable screen space. Any idea where I can stop it from displaying that tag?

Thanks so much in advance!

2 Mar 21, 2007 15:09

B2e uses little Java Script, but some as you found out. I do not know whether you can remove it or not.

Your second question is easier. Look for _lastcomments.php in either the ../blogs/skins/your_skin/ folder or ../blogs/skins/. On the lines 40-43 you find:

		<div class="bCommentTitle">
			<?php $Comment->author() ?>
			<?php $Comment->author_url( '', ' &middot; ', '' ) ?>
		</div>

Good luck.

3 Mar 21, 2007 15:22

Changing $Comment->author(); to $Comment->author('', ''); in _feedback.php did the trick.

Now only if I can find that javascript.... :'(

4 Mar 21, 2007 15:38

keatonatron wrote:

Changing $Comment->author(); to $Comment->author('', ''); in _feedback.php did the trick.

Now only if I can find that javascript.... :'(

You'd even better comment it out like so:

<!--
      <div class="bCommentTitle">
//         <?php $Comment->author() ?>
//         <?php $Comment->author_url( '', ' &middot; ', '' ) ?>
      </div>
-->

5 Mar 21, 2007 15:46

I didn't want to remove the user's name altogether, I just wanted to remove the [visitor] title that gets attached to the end.

These are the first 4 parameters for the author() method (notice number 2 ;) ):

1. String to display before author name if not a user
2. String to display after author name if not a user
3. String to display before author name if he's a user
4. String to display after author name if he's a user

7 Mar 21, 2007 19:54

The javascript gets generated by the Form class (inc/_misc/_form.class.php). This is meant for some special handling (maybe "check all" etc), but gets outputted with every Form - wether it uses this functionality or not. It should be quite save to remove this.

OTOH I rather think that the mobile device should ignore the Javascript (SCRIPT) tags, shouldn't it?

8 Mar 21, 2007 20:17

blueyed wrote:

OTOH I rather think that the mobile device should ignore the Javascript (SCRIPT) tags, shouldn't it?

You would think so. The strange thing is that the actual tags don't show up, but the scripting in between them does. The second tag is also visible, but much better than the first (it shows up simply as "//").

There are so many standards and "half-capable" devices these days, it's hard to know exactly what's going on in there. My cell phone can handle flash and Java applets, but has no clue what to do with CSS or javascript.

Thanks a lot for the info, I'll look into it in the morning!


Form is loading...