text based language menu via Typoscript - menu

I want to click on the text "English" to get the english version of the website. Before I had a graphical menu:
lib.tslangmenu = HMENU
lib.tslangmenu {
special = language
special.value = 0,1,2
addQueryString = 1
1 = GMENU
1.NO {
XY = 24,16
5 = IMAGE
5.file = fileadmin/templates/images/deutsch.jpg || fileadmin/templates/images/englisch.jpg || fileadmin/templates/images/kroatisch.jpg
}
1.ACT < 1.NO
1.ACT = 1
1.ACT.wrap = <span class="langhide"> | </span>
1.CUR < 1.ACT
1.CUR = 1
}
This worked so far. Now I should change the menu to a text-based menu.
lib.tslangmenu {
special = language
special.value = 0,1,2
special.normalWhenNoLanguage = 0
addQueryString = 1
1 = TMENU
1.NO = 1
1.NO.stdWrap.override = Deutsch || English || Hrvatski
1.ACT < 1.NO
1.ACT = 1
1.ACT.stdWrap = <span class="langhide"> | </span>
1.CUR < 1.ACT
1.CUR = 1
}
Now the wrap with the span is completely ignored. Also the menu is now displayed as follows:
MyCurrentPageName English Hrvatski
If I'm on german the word deutsch is overwritten with the current page title. The same is valid for all other languages. I also tried the TS given in this blog article. But currently it does the same. How do I get this working?

The first error is in your wrap: NO is not wrapped, so no span is generated (for NO-items). The problem that the page title is shown comes from wrong copying. The line
1.ACT < 1.NO
should really be
1.ACT < .1.NO
Just in case, here is a TS-config I have in active use:
lib.languageMenu = HMENU
lib.languageMenu {
special = language
special.value = 0,1
1 = TMENU
1 {
wrap = <ul class="langMenu">|</ul>
noBlur = 1
NO = 1
NO {
linkWrap = <li class="menu-item normal">|</li>
stdWrap.override = English || Deutsch
stdWrap.htmlSpecialChars = 1
}
ACT < .NO
ACT {
doNotLinkIt = 1
linkWrap = <li class="menu-item active">|</li>
}
# NO + Translation doesn't exist
USERDEF1 < .NO
USERDEF1.doNotLinkIt = 1
# ACT + Translation doesn't exist
USERDEF2 < .ACT
USERDEF2.doNotLinkIt = 1
}
}
Regards,
Jost

Check Here with flag icon
lib.languageMenu = HMENU
lib.languageMenu{
special = language
special.value = 0,1
protectLvar = 1
special.normalWhenNoLanguage = 0
# wrap = <div class="language"><ul>|</ul></div>
1 = TMENU
1 {
NO = 1
NO {
# linkWrap = <li class="in-active">|</li> || <li class="in-active">|</li>
stdWrap.override = {$germanLabel}<img alt="" src="typo3conf/ext/website_lctech/Resources/Public/images/german.png">|| {$englishLabel}<img alt="" src="typo3conf/ext/website_lctech/Resources/Public/images/english.png">
doNotLinkIt = 1
stdWrap.typolink.parameter.data = page:uid
stdWrap.typolink.additionalParams = &L=0 || &L=1
stdWrap.typolink.addQueryString = 1
stdWrap.typolink.ATagParams =class="InActive"
stdWrap.typolink.addQueryString.exclude = id,cHash,no_cache
stdWrap.typolink.addQueryString.method = GET
stdWrap.typolink.useCacheHash = 0
stdWrap.typolink.no_cache = 0
stdWrap.htmlSpecialChars = 0
# normalWhenNoLanguage = 0
}
ACT = 1
ACT < .NO
ACT.stdWrap.typolink.ATagParams =class="Active"
ACT.stdWrap.htmlSpecialChars = 0
# USERDEF1 < .NO
# USERDEF1.doNotLinkIt = 0
}
}

Related

Variable issue in GameMaker 2

Making a game in GameMaker and I'm having a problem where the variable is not set and I'm not sure why. When pressing down on either W,A,S, or D and clicking LMB it works but crashes if I pressing down on W,A,S, or D then let go and afterwards click LMB.
Code:
var look
var bullet
if (keyboard_check(ord("A"))){
x = x - 5;
sprite_index = spr_west_hiro
image_xscale = 3
image_yscale = 3
look = 180
} else if (keyboard_check(ord("D"))){
x = x + 5;
sprite_index = spr_east_hiro
image_xscale = 3
image_yscale = 3
look = 0
} else if (keyboard_check(ord("S"))){
y = y + 5;
sprite_index = spr_south_hiro
image_xscale = 3
image_yscale = 3
look = 270
} else if (keyboard_check(ord("W"))){
y = y - 5;
sprite_index = spr_north_hiro
image_xscale = 3
image_yscale = 3
look = 90
}
//------------------------------------------------------------------------------
if (keyboard_check_released(ord("A"))){
sprite_index = spr_idlewest_hiro
image_xscale = 3
image_yscale = 3
look = 180
} else if (keyboard_check_released(ord("D"))){
sprite_index = spr_idleast_hiro
image_xscale = 3
image_yscale = 3
look = 0
} else if (keyboard_check_released(ord("S"))){
sprite_index = spr_idlesouth_hiro
image_xscale = 3
image_yscale = 3
look = 270
} else if (keyboard_check_released(ord("W"))){
sprite_index = spr_idlenorth_hiro
image_xscale = 3
image_yscale = 3
look = 90
}
//--------------------------------------------------------------------------------
if (mouse_check_button_pressed(mb_left)){
var bullet = instance_create_layer(x,y, "Instances", obj_bullet)
bullet.direction = look
}
Error:
ERROR!!! :: ############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_hiro:
local variable look(100001, -2147483648) not set before reading it.
at gml_Object_obj_hiro_Step_0 (line 61) - bullet.direction = look
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_hiro_Step_0 (line 61)
I have reviewed the code multiple times and I am still stumped. Particularly because of the fact that it seems as though the variable doesn't save the coefficient set to it despite the fact that it should when W,A,S or D is pressed down then released.
Firstly, you would want to assign a value to your look variable, as otherwise it will remain not set to anything if no buttons had been pressed.
Secondly, you may want to do so in Create event, as you probably want your character to shoot in last pressed direction, not just "somewhere"

Count of range of columns with null rows in excel

I have run into a weird problem. It may be simple one, but I am unable to trace out a solution for the same.
I have 10 columns in excel where 8 columns has data and 2 columns doesn't have the data, Now want to get the count of the null columns.
a b c d e(null count)
10 10 2
5 3
4
I tried using ISBlank, CountBlank but nothing is woking for me.
Edit
When I use count bank I am getting some weird symbol equal to zero (sorry, I am unable to attach screen shot).
My code is
COUNTBLANK(D9:I9)=0
Edit
This is my code:
=IF(AND(COUNTBLANK(D9:I9)=0,COUNTBLANK(K9:P9)=0,Q9="",R9="",T9="",COUNTBLANK(V9:AF9)=0,AH9="",AK9="",AM9="",AO9=""),"",SUM(D9:I9,K9:P9,Q9,R9,T9,V9:AF9,AH9,AK9,AM9,AO9))
personal data:
<header id="head">
<!-- <img src='Images/12.jpg' width=screen.width > -->
this is god
</header>
<script>
/* <!--function slide(){ */
var ima = ['12.jpg','Pooja Vidhanam Pic.jpg' ];
/* document.getElementById("head").innerHTML ="'"+"Images/"+ima[1]+"'";
var txt="'"+"Images/"+ima[0]+"'"; */
for (i = 0; i < ima.length; i++) {
var x = document.createElement("IMG");
x.setAttribute("src", "Images/"+ima[i]);
x.setAttribute("width", "304");
x.setAttribute("height", "228");
x.setAttribute("alt", "The Pulpit Rock");
//x.setAttribute(name, value)
//document.getElementById("head").appendChild(document.createElement("<img src= txt width=screen.width >"));
document.getElementById("head").appendChild(x);
//sleep(1000);
}
/* for (i=0;i<ima.length;i++){
<img src="Images/"+images[i]+" width=screen.width" >
document.getElementById("head").innerHTML=ima[i];
} */
</script>
<!-- <script>
var cars = ["BMW", "Volvo", "Saab", "Ford", "Fiat", "Audi"];
document.getElementById("head").innerHTML = cars[0];
var text = "";
var i;
for (i = 0; i < cars.length; i++) {
text += cars[i] + "<br>";
document.getElementById("head").innerHTML = text;
}
</script> -->

TYPO3 generate link menu of subpage/level 2

If I have this code I can generate a link menu. and say that I only want to include Uid 4 and 8.
lib.leftNavi = HMENU
lib.leftNavi.entryLevel=0
lib.leftNavi.special = list
lib.leftNavi.special.value = 4,8
lib.leftNavi.1 = TMENU
lib.leftNavi.1 {
wrap = <div id="leftMenu"><ul class="L1">|</ul></div>
expAll = 0
NO = 1
NO.allWrap = <li>|</li>
NO.stdWrap.wrap = <span>|</span>
RO < .NO
RO = 1
CUR < .NO
CUR = 1
CUR.allWrap = <li class="current">|</li>
CUR.stdWrap.wrap = <span>|</span>
CUR.ATagParams =
ACT < .CUR
}
My question is now..
How can I say that I want to generate a link menu, from/of the sub pages under Uid 4, so it don't show the link to Uid 4, but the 3-5 sub-pages under this Uid ?
..UPDATE..
Okay I have this code now, and its almost OK.
lib.prodNavi = HMENU
lib.prodNavi.entryLevel=0
lib.prodNavi.special = list
lib.prodNavi.special.value = 5
lib.prodNavi.1 = TMENU
lib.prodNavi.1 {
wrap = <div id="categorylist-box"><div id="categorylist-box-top"><h2><em>Produkter</em></h2></div><div id="categorylist-box-content"><ul>|</ul></div><div id="categorylist-box-bottom"></div></div><div class="pagecontent-box" id="pagecontent-box-59">
expAll = 1
NO = 1
NO.allWrap = <li>|</li>
NO.stdWrap.wrap = <span>|</span>
NO.doNotShowLink = 0
NO.doNotShowLink.stdWrap.override = 1
NO.doNotShowLink.stdWrap.if {
equals.field = uid
value = 5
}
RO < .NO
RO = 1
CUR < .NO
CUR = 1
CUR.allWrap = <li class="current">|</li>
CUR.stdWrap.wrap = <span>|</span>
CUR.ATagParams =
ACT < .CUR
}
lib.prodNavi.2 < lib.prodNavi.1
But it show me to oranges boxes, almost as it using the Wrap 2 times.
How do I only show it like this, with one wrap.
You can use doNotShowLink = 1 for hiding menu items. And you can use stdWrap.override for hiding single items.
Here you would show uid 8 and subpages and subpages of uid 4. uid 4 itself would not be shown
lib.leftNavi = HMENU
lib.leftNavi.entryLevel=0
lib.leftNavi.special = list
lib.leftNavi.special.value = 4,8
lib.leftNavi.1 = TMENU
lib.leftNavi.1 {
wrap = <div id="leftMenu"><ul class="L1">|</ul></div>
expAll = 1
NO = 1
NO.allWrap = <li>|</li>
NO.stdWrap.wrap = <span>|</span>
NO.doNotShowLink = 0
NO.doNotShowLink.stdWrap.override = 1
NO.doNotShowLink.stdWrap.if {
equals.field = uid
value = 4
}
RO < .NO
RO = 1
CUR < .NO
CUR = 1
CUR.allWrap = <li class="current">|</li>
CUR.stdWrap.wrap = <span>|</span>
CUR.ATagParams =
ACT < .CUR
}
lib.leftNavi.2 < lib.leftNavi.1
UPDATE:
For Using the wrap only once just use it for the HMENU, not for the TMENU:
lib.prodNavi = HMENU
lib.prodNavi.entryLevel=0
lib.prodNavi.special = list
lib.prodNavi.special.value = 252
lib.prodNavi.wrap = <div id="categorylist-box"><div id="categorylist-box-top"><h2><em>Produkter</em></h2></div><div id="categorylist-box-content"><ul>|</ul></div><div id="categorylist-box-bottom"></div></div><div class="pagecontent-box" id="pagecontent-box-59">
lib.prodNavi.1 = TMENU
lib.prodNavi.1 {
expAll = 1
NO = 1
NO.allWrap = <li>|</li>
NO.stdWrap.wrap = <span>|</span>
NO.doNotShowLink = 0
...
}
lib.prodNavi.2 < lib.prodNavi.1

Encode and decode an Adobe Dreamweaver password in *.ste file

How is a password encoded or decoded in order to retrieve a password from an Adobe Dreamweaver *.ste file, or to dynamically create a *.ste file designed to be imported into Dreamweaver?
This Javascript function can be used to encode the password:
function encodePassword(input)
{
var top = 0;
var output = '';
for(var i = 0; i < input.length; i++){
var currentChar = input.charCodeAt(i);
if(currentChar < 0 || currentChar > 0xFFFF){return(false);}
if(top != 0){
if(0xDC00 <= currentChar && currentChar <= 0xDFFF){
output += dec2hex(0x10000 + ((top - 0xD800) << 10) + (currentChar - 0xDC00) + i) + '';
top = 0;
continue;
// Insert alert for below failure
}else{return(false);}
}
if(0xD800 <= currentChar && currentChar <= 0xDBFF){top = currentChar;}
else{output += dec2hex(currentChar + i) + '';}
}
return(output);
}
function dec2hex(input){return(input+0).toString(16).toUpperCase();}
And this function can be used to decode the password:
function decodePassword(input)
{
var output = "";
if(input.length == 0){return("");}
for(var i = 0; i < input.length / 2; i++){
var currentHex = parseInt(input.substr(i * 2, 2), 16);
if(currentHex <= 0xFFFF){
output += String.fromCharCode(currentHex - i);
}else if(currentHex <= 0x10FFFF){
currentHex -= 0x10000
output += String.fromCharCode(0xD800 | (currentHex >> 10)) + String.fromCharCode(0xDC00 | (currentHex & 0x3FF) - i);
}else{
//Insert alert for below failure
return(false);
}
}
return(output);
}
You can also do this online without any code using this tool: http://blog.affirmix.com/2009/05/05/live-ste-dreamweaver-password-encoder-and-decoder/
To decode the Dreamweaver password you break the password into pairs of hexadecimal (0-9, A-F) digits then subtract from each hex digit based on it's position in the string, starting with 0, then convert back to ascii.
The encrypted password of 5470714865787F would be...
54-0 = 54 => T
70-1 = 6F => o
71-2 = 6F => o
48-3 = 45 => E
65-4 = 61 => a
78-5 = 73 => s
7F-6 = 79 => y
So 5470714865787F => 'TooEasy'
We have a working example of this on our website which allows you to decode your password. You can also copy/paste your entire .ste file and it will output the needed FTP details to connect, save some time...
http://www.mywebsitespot.com/dreamweaver-password-decode
Sorry to wake up an old thread but thought I'd post my solution. It's a single HTML5 page that can load and parse Dreamweaver STE files, decoding the password as part of that. I wanted something simple, offline/local (so details aren't transmitted when decoding) that I could to just load an STE file in to and it would give me all the FTP details:
Blog Post:
http://bobmckay.com/web/dreamweaver-password-ste-file-decoder
Decoder Page:
http://bobmckay.com/dreamweaver-password-decoder/
Hope it's useful to someone!
Bob
Waking an old thread, but in addition to the accepted JavaScript answer, I just wanted to leave two PHP functions for anyone interested:
To encode a password:
function dwste_encode( $pw ){
$output = '';
$split = str_split( $pw );
foreach( $split as $key => $value ){
$char = ord( $value );
$char = ( $char + $key );
$char = dechex( $char );
$output .= strtoupper( $char );
}
return $output;
}
To decode a password:
function dwste_decode( $pw ){
$output = '';
$split = str_split( $pw, 2 );
foreach( $split as $key => $value ){
$char = hexdec( $value );
$char = ( $char - $key );
$char = chr( $char );
$output .= $char;
}
return $output;
}
I needed to create many DW ste files for a client today. I used the following VBA to do it straight from Excel. I used the code from #andrew-odri as the basis.
Function decodeDreamWeaverPass(sHash$)
Dim sPass$, i&, lHash&, lChar&, sChars$
lHash = Len(sHash) - 1
For i = 0 To lHash Step 2
sChars = Mid(sHash, i + 1, 2)
lChar = CLng("&H" & sChars)
lChar = lChar - (i / 2)
sPass = sPass & Chr(CLng(lChar))
Next
decodeDreamWeaverPass = sPass
End Function
Function encodeDreamWeaverPass(sPassword$)
Dim lTop&, i&, sOutput$
Dim lPassword&, sChar$, lChar&
lTop = 0
lPassword = Len(sPassword) - 1
For i = 0 To lPassword
lChar = Asc(Mid(sPassword, i + 1, 1))
sChar = Chr(lChar)
If ((lChar < 0) Or (lChar > 65535)) Then
encodeDreamWeaverPass = ""
End If
If lTop > 0 Then
If (lChar >= 56320) And (lChar <= 57343) Then
sOutput = sOutput & Hex(65536 + ((lTop - 55296) Xor 10) + (lChar - 56320) + i)
lTop = 0
Else
encodeDreamWeaverPass = ""
End If
End If
If (lChar >= 55296) And (lChar <= 56319) Then
lTop = lChar
Else
sOutput = sOutput & Hex(lChar + i)
End If
Next
encodeDreamWeaverPass = sOutput
End Function

Sphinxsearch index min_stemming_len

Here is my sphinx search configuration (sphinxsearch_0.9.9-6_amd64):
index FULL
{
charset_type = utf-8
source = FULL
path = /var/sphinx/data/Full
docinfo = extern
mlock = 0
min_stemming_len = 1
min_prefix_len = 1
min_word_len = 1
html_strip = 1
index_exact_words = 1
}
searchd
{
listen = 192.168.2.3
log = /var/log/sphinxsearch/searchd.log
query_log = /var/log/sphinxsearch/query.log
read_timeout = 3
client_timeout = 60
max_children = 30
pid_file = /var/run/searchd.pid
max_matches = 1000
seamless_rotate = 1
preopen_indexes = 0
unlink_old = 1
mva_updates_pool = 1M
max_packet_size = 8M
max_filters = 256
max_filter_values = 4096
}
I use php as client
$sphinx_client->SetServer('localhost', 9312);
$sphinx_client->SetConnectTimeout(1);
$sphinx_client->SetArrayResult(true);
$sphinx_client->setRankingMode(SPH_RANK_WORDCOUNT);
$sphinx_client->SetMatchMode(SPH_MATCH_EXTENDED2);
if ($mode == 'all') {
$sphinx_client->SetSortMode(SPH_SORT_RELEVANCE, 'category');
} else {
$sphinx_client->setFilter('category', array($this->_filter_category), FALSE);
}
$sphinx_client->SetLimits(0, $this->_limit);
$results = $sphinx_client->Query('"^'.$query.'$"', 'FULL');
for example i have those names in index :
1. Alex
2. Alen
3. George
4. A
5. G
::: When i try to search for simple 1 char string "A" i get Alen / Alex / A and so on.
How can i search based on string length so i can display them in right order like :
A / Alen / Alex ...
I also get "WARNING: index 'FULL': no morphology, index_exact_words=1 has no effect, ignoring"
Best Regards
use an ordinal field ( str2ordinal ) , do your normal search , but modify sort mode : switch to extended mode and use a combination like $sphinx_client->SetSortMode(SPH_SORT_EXTENDED, '#weight desc , myordinal asc');

Resources