Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: [1] 2

Author Topic: Can someone check my snews file preview function dont work  (Read 6176 times)

Sasha

  • Hero Member
  • *****
  • Karma: 28
  • Posts: 938
    • cssanarchy.com
Can someone check my snews file preview function dont work
« on: September 06, 2008, 10:38:40 am »

I have problem with my snews and i canot fix by myself so i need your help.For some reason my preview function dont work after i login in admin section.Dont ask me way i dont know  ??? .I have some simple mode instaled but that mode is most about data time and calendar nothing more.You can download my snews file for testing http://cssanarchy.com/snews.rar  and thank you for help....
« Last Edit: September 07, 2008, 06:26:01 am by Sasha »
Logged
Every morning, I get up and look through the 'Forbes' list of the richest people in America. If I'm not there, I go to work. | If you love your job, you haven't worked a day in your life. snews with ♥

Joost

  • Guest
Re: Can someone check my snews file
« Reply #1 on: September 06, 2008, 02:36:22 pm »

Preview is a javascript driven feature. Perhaps there's a conflict with the javascipt from the calendar.
Logged

Sasha

  • Hero Member
  • *****
  • Karma: 28
  • Posts: 938
    • cssanarchy.com
Re: Can someone check my snews file
« Reply #2 on: September 07, 2008, 04:11:01 am »

so canot be fixed?
Logged
Every morning, I get up and look through the 'Forbes' list of the richest people in America. If I'm not there, I go to work. | If you love your job, you haven't worked a day in your life. snews with ♥

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: Can someone check my snews file
« Reply #3 on: September 07, 2008, 04:32:16 am »

Hello Sasha

Did you try fix with this mod.

I haven't callendar script to try, can you send me your index.php/and script to
ruijmendes]at[gmail.com
« Last Edit: September 07, 2008, 04:42:33 am by Rui Mendes »
Logged
Need a Job on Europe. Linkdin - Facebook / Group

Sasha

  • Hero Member
  • *****
  • Karma: 28
  • Posts: 938
    • cssanarchy.com
Re: Can someone check my snews file
« Reply #4 on: September 07, 2008, 04:49:36 am »

i send tree files snews script,calendar script and index.php file.also i use mod for another calendar http://snewscms.com/forum/index.php?topic=7431.0 ...thank you RUI for help...
Logged
Every morning, I get up and look through the 'Forbes' list of the richest people in America. If I'm not there, I go to work. | If you love your job, you haven't worked a day in your life. snews with ♥

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: Can someone check my snews file
« Reply #5 on: September 07, 2008, 05:11:25 am »

Very strange, everything is fine in localhost. I send to you a screenshot.

What browser are you using? and your operating system?

Try fix with my mod and tellme.
Logged
Need a Job on Europe. Linkdin - Facebook / Group

Sasha

  • Hero Member
  • *****
  • Karma: 28
  • Posts: 938
    • cssanarchy.com
Re: Can someone check my snews file
« Reply #6 on: September 07, 2008, 05:14:34 am »

i use mozilla opera safari i IE7.also i use windovs vista.i know is a strange  ???
Logged
Every morning, I get up and look through the 'Forbes' list of the richest people in America. If I'm not there, I go to work. | If you love your job, you haven't worked a day in your life. snews with ♥

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: Can someone check my snews file
« Reply #7 on: September 07, 2008, 05:26:00 am »

OK use my mod and try this

I have same problem with lightbox, here is my solution:
In title function
Quote
   if ($_SESSION[db('website').'Logged_In'] == token()) {js();}
   #ADDON GALLERY - if you want use LightBox add this scripts (to avoid mess admin functions, like toggle when logged)
   else {
      echo '<script type="text/javascript" src="js/prototype.js"></script>';
      echo '<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>';
      echo '<script type="text/javascript" src="js/lightbox.js"></script>';}
   // END ADDON GALLERY - Lightbox

any doubts, see my sNews galleries basic edition.
Logged
Need a Job on Europe. Linkdin - Facebook / Group

Sasha

  • Hero Member
  • *****
  • Karma: 28
  • Posts: 938
    • cssanarchy.com
Re: Can someone check my snews file
« Reply #8 on: September 07, 2008, 05:47:31 am »

i try your code but dont work  ??? i guess snews has some problems.my snews looks good and i cant found any problems but preview dont work.
Logged
Every morning, I get up and look through the 'Forbes' list of the richest people in America. If I'm not there, I go to work. | If you love your job, you haven't worked a day in your life. snews with ♥

Sasha

  • Hero Member
  • *****
  • Karma: 28
  • Posts: 938
    • cssanarchy.com
Re: Can someone check my snews file
« Reply #9 on: September 07, 2008, 06:00:23 am »

oky i got it work.i download snews 1.5.31 and copy/replace java script function in my snews 1.6 with one from 1.5.31 and now preview works.this is strange and i guess you guys has some problem with java script function in snews 1.6....
« Last Edit: September 07, 2008, 06:03:40 am by Sasha »
Logged
Every morning, I get up and look through the 'Forbes' list of the richest people in America. If I'm not there, I go to work. | If you love your job, you haven't worked a day in your life. snews with ♥

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: Can someone check my snews file
« Reply #10 on: September 07, 2008, 06:06:15 am »

I'm glad you make work, can you send me your snews again, or explain what you did to understand what's happen with your browser.

Best regards
Logged
Need a Job on Europe. Linkdin - Facebook / Group

Sasha

  • Hero Member
  • *****
  • Karma: 28
  • Posts: 938
    • cssanarchy.com
Re: Can someone check my snews file
« Reply #11 on: September 07, 2008, 06:11:12 am »

oky what i do is i downloaded fresh snews file 1.5.31 version and copy this code and replace same one in snews 1.6  with this code from snews 1.5.31
Code: [Select]
// JAVASCRIPT FUNCTIONS
function js() { ?>
<script type="text/javascript">
//<![CDATA[
var allowsef = /new|add|_ar|_ca/.test("<?php echo get_id('category').$_GET['action']; ?>");
var allowpreview = /new|_add|_ar|/.test("<?php echo get_id('category').$_GET['action']; ?>");

// copy title in the sef url field
if (allowpreview == true) { window.onLoad = startPreview(); }
function startPreview() { window.self.setInterval("updatePreview()", 1000); }

// generate SEF urls
function genSEF(from,to) {
if (allowsef == true) {
var str = from.value.toLowerCase();
str = str.replace(/[^a-zA-Z 0-9]+/g,'');
str = str.replace(/\s+/g, "-");
to.value = str;
}
}

// generate preview
function updatePreview() {
if (document.getElementById("txt")) {
var body = document.getElementById("txt").value;
//body = body.replace(/\n/g, '<br />');
document.getElementById("preview").innerHTML = body;
}
}

// settings home SEF restrict to alphanumeric
function SEFrestrict(x) {
if (window.event)
    var key = window.event.keyCode;
else if (x)
    key = x.which;
else
    return true;
var keychar = String.fromCharCode(key);
keychar.toLowerCase();
if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )
    return true;
else if ((("abcdefghijklmnopqrstuvwxyz0123456789-_").indexOf(keychar) > -1))
    return true;
else
    return false;
}
// delete warnings
function pop() {
var agree=confirm("<?php echo l('warning_delete'); ?>");
if (agree)
return true;
else
return false;
}

// basic html textarea editor
function tag(tag) {
    var src = document.getElementById("txt");
    if(tag == 'break'){ start = "[break]"; end = "";}
else if(tag == 'br'){ start = ""; end = "<br />";}
    else if(tag == 'img'){
    var url = prompt("<?php echo l('image_url'); ?>", "");
var alt = prompt("<?php echo l('image_alt'); ?>", "");
if(url != null) { start = "<img src=\""+url+"\" alt=\""+alt+"\" />"; end = ""; } else { start = ""; end = ""; }
} else if(tag == 'link'){
var url = prompt("<?php echo l('link_url'); ?>", "");
var title = prompt("<?php echo l('link_title'); ?>", "");
if(url != null) { start = "<a href=\""+url+"\" title=\""+title+"\">"; end = "<\/a>"; } else { start = ""; end = ""; }
} else if(tag == 'include'){
    var url = prompt("<?php echo l('file_url'); ?>", "");
if(url != null) { start = "[include]" + url + "[/include]"; end = ""; } else { start = ""; end = ""; }
} else { var start = "<" + tag + ">"; var end = "</" + tag + ">"; }
if(!src.setSelectionRange) {
var selected = document.selection.createRange().text;
if(selected.length <= 0) { src.value += start + end;
        } else {
            var codetext = start + selected + end;
            document.selection.createRange().text = codetext;
        }
} else {
        var pretext = src.value.substring(0, src.selectionStart);
        var codetext = start + src.value.substring(src.selectionStart, src.selectionEnd) + end;
        var posttext = src.value.substring(src.selectionEnd, src.value.length)
        if(codetext == start + end)
            codetext = start + end;
            src.value = pretext + codetext + posttext;
    }
src.focus();
}
// toggle dynamic divs
function toggle(div) {
if (document.getElementById(div).style.display=='') {
document.getElementById(div).style.display = 'none';
return
} document.getElementById(div).style.display = '';
}
// dependancy limiter
function dependancy() {
var category = document.forms['post']['define_category'];
var page = document.getElementById("def_page");
if (category.options[category.selectedIndex].value == "-1") { page.style.display = 'inline'; }
else { page.style.display = 'none'; }
}
//]]>
</script>
<?php ?>

snews 1.6 java function may have problem to work in os vista which i use but this code above fix that.also Rui i canno't aces your site?
« Last Edit: September 07, 2008, 06:19:58 am by Sasha »
Logged
Every morning, I get up and look through the 'Forbes' list of the richest people in America. If I'm not there, I go to work. | If you love your job, you haven't worked a day in your life. snews with ♥

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Can someone check my snews file preview function dont work
« Reply #12 on: September 07, 2008, 01:05:16 pm »

Rui is moving to another host.

I think this:
"O Site encontra-se em manutenção, as minhas sinceras desculpas"

mean this:
"The site is in maintenance. My sincerest apologies."

In romanian:
"Situl se afla in mentenanta, scuzele mele sincere."
« Last Edit: September 07, 2008, 01:22:05 pm by funlw65 »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: Can someone check my snews file preview function dont work
« Reply #13 on: September 07, 2008, 03:06:36 pm »

Rui's most recent Javascript Patch appears to solve the issue without replacing all of your 1.6 Jscript with 1.5.31 Jscript... and this Patch was added to the official 1.6 download on September 02.08.  ;)
« Last Edit: September 08, 2008, 04:26:46 pm by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Sasha

  • Hero Member
  • *****
  • Karma: 28
  • Posts: 938
    • cssanarchy.com
Re: Can someone check my snews file preview function dont work
« Reply #14 on: September 08, 2008, 03:48:22 am »

hm.That pacth and mod dont work on my site .Only one from 1.5.31 work fine.You guys have some problem with snews 1.6 java function and if i m you guys (dudes) all be testing again that.Lot of people may have problem with this same like me.It is no good have file for download and one of admin function dont work properly....Like I sead THIS MOD FROM RUI DONT WORK with probable vista..period...good luck  and your link above keyrocks dont work  8).Oky one more thing when i overide my snews file with this new one from september one i lost my site footer and code
Code: [Select]
<?php new_comments(660); ?> dont show up.....i also tray java script function from 1.5.31 in september one and same problem no footer no new comment code ...strange...
« Last Edit: September 08, 2008, 04:05:59 am by Sasha »
Logged
Every morning, I get up and look through the 'Forbes' list of the richest people in America. If I'm not there, I go to work. | If you love your job, you haven't worked a day in your life. snews with ♥
Pages: [1] 2