rejetto forum

Software => HTML & templates => HFS ~ HTTP File Server => RAWR-Designs => Topic started by: regchan on April 09, 2021, 05:47:10 PM

Title: cant install theme on 2.4.0 RC 6
Post by: regchan on April 09, 2021, 05:47:10 PM
please help cant install any themes thats avalible on here any help would be appreciated
trying to load is not compatable any help will be appreciated thanks
Title: Re: cant install theme on 2.4.0 RC 6
Post by: NaitLee on April 10, 2021, 04:56:44 AM
HFS themes ("Templates") are version-sensitive. Generally, templates be used in HFS 2.3m can't be used in 2.4 RC, and vise versa.

So there are choices:
- HFS 2.3m: try Throwback for 2.3, RAWR Template series etc.
- HFS 2.4 RC: try Throwback for 2.4, mobil-light, Takeback, Fuh 2.0 etc.

Technically explained:
In templates' source code, there is an [api level] section in 2.4 templates, which is used to identify new templates
In 2.4 if there is no such a section with value >= 2, will raise an error.
Title: Re: cant install theme on 2.4.0 RC 6
Post by: danny on April 11, 2021, 06:09:08 AM
Replace/Add/Update these [sections]
Code: [Select]
[api level]
999

[error-page]
%content%
[overload]
{.if|{.{.calc|{.get ini|max-connections.}.}<>0.}|{:{.set ini|max-connections=-1.}:}.}{.disconnect.}{.add to log|%ip% %user% disconnected at %connections% connections.}

[max contemp downloads]
{.add header|Cache-Control: no-cache, max-age=0.}{.redirect|/~server%20is%20busy?path={.encodeuri|{.filepath|%url%.}.}.}
[server is busy|public]
<!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1">
<META HTTP-EQUIV="Refresh" CONTENT="3;URL={.decodeuri|{.urlvar|path.}.}"><TITLE>Busy</TITLE><link rel="icon" href="data:,"></head>
<body bgcolor="#EDF0F9"><center><h2><br>Server is busy.</h2>Returning to previous page...</center></body></html>

[not found]
{.if|{.match|*.php*;*.js;*.py;*.vbs*;*.exe|%url%.}|{:{.disconnect.}:}.}{.add header|Cache-Control: no-cache, max-age=0.}<!DOCTYPE html><html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1">
<META HTTP-EQUIV="Refresh" CONTENT="1;URL=../"><TITLE>404</TITLE><link rel="icon" href="data:,"></head>
<body bgcolor="#EDF0F9"><center><h2><br>You have found the 404 page.</h2></center></body></html>

[unauth]
{.redirect|/~login.}

[deny]
{.disconnection reason|NO.}

[ban]
{.disconnect.}

[ajax.changepwd|public|no log]
{.check session.}
{.break|if={.not|{.can change pwd.}.} |result={.!Forbidden.} (0).}
{.if|{.length|{.set account||password={.postvar|new.}.}/length.}|{.!OK.} (1)|{.!Failed.} (2).}

[login|public]
{.if|{.match|*.php*;*.js;*.py;*.vbs*;*.exe|%url%.}|{:{.disconnect.}:}.}{.add header|Cache-Control: no-cache, max-age=0.}<!DOCTYPE html><html lang="en"><head><meta charset=UTF-8 /><meta name="viewport" content="width=device-width, initial-scale=1"><meta http-equiv=CACHE-CONTROL content=no-cache><title>HFS %version%</title><link rel="icon" href="data:,"></head>
<body bgcolor="black" text="white" alink="white" link="white" vlink="white">
<font size=4><center><br><br><br>
    <form method='post' onsubmit='return login()' >  <!-- return true   / -->
      <table border="0" cellspacing="20">
      <tr><td align='right'><label for="user">{.!Username.}</label><td><input name='user' size='25' required placeholder="%user%" id='user' />
      <tr ><td align='right'><label for="pw">{.!Password.}</label><td><input name='password' size='25' type='password' required id='pw' />
      <tr ><td><td><input type='submit' value='{.!Login.}' style='margin-top:13px'>
      </table>
    </form>
<font size="2">Keep me logged-in<input type="checkbox"></font><br><br>
<button onclick="var tmp=prompt('new password'); if(tmp) {var fd=new FormData();fd.append('new',tmp);fd.append('token','{.cookie|HFS_SID_.}');fetch('/~ajax.changepwd',{method:'POST',body:fd})}" hidden>{.!Change password.}</button>
<br><br>
</center>
<script>
const loc={}; loc.Logout='{.!Logout.}'  /*translate here*/
var sha256 = function(s) {return SHA256.hash(s)}
function logout() {fetch("/?mode=logout").then(res => location.reload()); return false;}
function login() {
    var sid = "{.cookie|HFS_SID_.}"  //getCookie('HFS_SID');
    if (!sid) return true;  //let the form act normally
    var usr = user.value;
    var pwd = pw.value;
var xhr = new XMLHttpRequest();
xhr.open("POST", "/?mode=login");  // /~login
var formData = new FormData();
formData.append("user",usr)
if (typeof SHA256 != 'undefined') formData.append("passwordSHA256",sha256(sha256(pwd).toLowerCase()+sid).toLowerCase()); else formData.append("password",pwd)
xhr.onload=function(){if(xhr.response=='ok') {
 if(document.querySelector("input[type=checkbox]").checked) localStorage.login=JSON.stringify([usr,pwd]); else localStorage.removeItem('login');
 location.replace(document.referrer)} else {alert("user or password don't match");document.querySelector("form").reset();location.reload(true)}}
xhr.send(formData)
    return false;
}
if(localStorage.login) document.querySelector("input[type=checkbox]").checked=true  //stop keep logged-in: call /~login and disable "Keep me logged-in"
document.querySelector("input[type=checkbox]").onchange=function(){if(!this.checked) localStorage.removeItem('login')}
if('%user%') {document.querySelector("input[type=submit]").value=loc.Logout; document.querySelector("input[type=submit]").onclick=function(){logout(); return false}; document.querySelector('button').hidden=false}
if(!'%user%' && localStorage.login) {
var tmp=JSON.parse(localStorage.login)
user.value=tmp[0]
pw.value=tmp[1]
var myform=document.querySelector("form"); if (myform.requestSubmit) myform.requestSubmit(); else myForm.submit()
} </script> <script src="/~sha256.js" onerror="setTimeout(()=> this.src='/~sha256.js',181)"></script>
Also update the target of [login-link] to href="/~login"

P.S. 
There are also '2.4-Ready' versions of Takeback, Throwback, Mobil-Light, Stripes, White, etc...
See also:  http://rejetto.com/forum/index.php?topic=13326.0
Title: Re: cant install theme on 2.4.0 RC 6
Post by: regchan on April 11, 2021, 10:22:38 PM
the theme i like using id this one Live 3.0.1.zip
 in black  as i like dark themes
Title: Re: cant install theme on 2.4.0 RC 6
Post by: regchan on April 12, 2021, 01:03:12 AM
i also lik this theme but i have a problem i can not  log out as i require this option
Title: Re: cant install theme on 2.4.0 RC 6
Post by: TSG on April 12, 2021, 01:34:24 AM
I no longer update these themes, as I no longer use HFS. You will need to rely on the forum to help you make them compatible with 2.4.
Title: Re: cant install theme on 2.4.0 RC 6
Post by: regchan on April 12, 2021, 01:43:00 AM
thanks ive tried to do it myself but i had issues it wirked but could not login and it showed 2 login screens and words server error message