Установка кода на Slaed CMS
Как поставить код на Slaed CMS? в какой файл?
|
создай php-блок
Цитата:
|
Когда добьетесь положительного результата - отпишитесь в эту тему, желательно по шагам. Для будущих поколений.
|
а ище?
в какой файл создавать етот блог?
|
Что в PHPNuke, что в Slaed, то в PHP-Fusion делать блоки со ссылками Sape очень просто.
1. создается файл block-Sape.php 2. кидается в папку root/blocks 3. в админке Slaed создать новый блок с указанием этого файла блока Sape, размещается слева-справа-по_центру. как угодно. включить блок. 4. не забываем закинуть в корень сайта папочку с файлом sape.php и дать ей права 777. если желаете порубить ссылки на куски: Цитата:
Ну а текст какой размещать - пусть ваша фантазия подсказывает. :) |
Создаю
Создаю в админке блог http://zhitomyr.info/ смотрите снизу а оно ошыбку викидает!
|
а папку на сервер залил?
Цитата:
|
ааа
папку залил и права поставил!
в файле * SAPE.ru -- Интеллектуальная система купли-продажи ссылок * * ASP.NET-клиент, Версия 0.6 от 31.05.2007 * * По всем вопросам обращаться на support@sape.ru * * Вебмастеры! Не нужно ничего менять в этом файле! Все настройки - через параметры при вызове кода. * Читайте: http://www.sape.ru/faq.php * */ using System; using System.Collections; using System.IO; using System.Text; using System.Net; using System.Web; using System.Xml; using System.Xml.XPath; namespace MyNameSpace { public class SAPE_client { #region Атрибуты private string _server = "http://dispenser-01.sape.ru/"; private string _code_php = @"code.php?user="; private string _sape_user = ""; private string _host = ""; private bool _multi_site = false; private string _request_uri = ""; private bool _verbose = false; private string _charset = "Windows-1251"; private double _cache_lifetime = 3600; private double _cache_reloadtime = 600; private string _db_file = "links.xml"; private string _links_db_file = ""; private HttpContext current = HttpContext.Current; private string mypage = "/default.aspx"; private string _error = ""; private string _version = "0.6"; private string _user_agent = "SAPE_Client_ASP.NET_"; private string _links_delimiter = ""; private ArrayList _links_page; private HttpWebRequest req; #endregion #region Конструкторы public SAPE_client() { throw new NotImplementedException("Не заданна константа _SAPE_USER"); } public SAPE_client(string sape_user, string host, bool multi_site, string request_uri, string charset, bool verbose) { if(sape_user.Length == 0) throw new NotImplementedException("Не заданна константа _SAPE_USER"); else _sape_user = sape_user; if(host.Length == 0) _host = current.Request.Url.Host.ToString(); else { _host = host; _host.Replace("http://",""); _host.Replace("www.",""); } if(multi_site) _multi_site = multi_site; if(request_uri.Length == 0) _request_uri = current.Request.Url.PathAndQuery.ToString(); else _request_uri = request_uri; if(!String.Equals(_charset,charset)) _charset = charset; if(verbose) _verbose = verbose; Load_links(); } public SAPE_client(string sape_user) :this(sape_user,"",false,"","Windows-1251",false){} public SAPE_client(string sape_user,string host) :this(sape_user,host,false,"","Windows-1251",false){} public SAPE_client(string sape_user,string host,bool multi_site) :this(sape_user,host,multi_site,"","Windows-1251",false){} public SAPE_client(string sape_user,string host,bool multi_site,string request_uri) :this(sape_user,host,multi_site,request_uri,"Windo ws-1251",false){} public SAPE_client(string sape_user,string host,bool multi_site,string request_uri,string charset) :this(sape_user,host,multi_site,request_uri,charse t,false){} #endregion #region Методы #region Load_Links private void Load_links() { if(_multi_site) _links_db_file = current.Server.MapPath(Path.Combine(current.Reques t.ApplicationPath,_sape_user+@"\"+_host+"."+_db_fi le)); else _links_db_file = current.Server.MapPath(Path.Combine(current.Reques t.ApplicationPath,_sape_user+@"\"+_db_file)); FileInfo myFile = new FileInfo(_links_db_file); if(!myFile.Exists) Fetch_remote_file(); else { if((myFile.Attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) myFile.Attributes = myFile.Attributes & ~FileAttributes.ReadOnly; if(myFile.Length == 0 | (myFile.LastWriteTime.AddSeconds(_cache_lifetime) < DateTime.Now)) { File.SetLastWriteTime(_links_db_file,myFile.LastWr iteTime.AddSeconds(_cache_reloadtime)); Fetch_remote_file(); } } XmlDocument doc = new XmlDocument(); try { doc.Load(_links_db_file); _links_delimiter = doc.DocumentElement.GetAttributeNode("delimiter"). InnerText.ToString(); if(String.Compare(_request_uri,mypage,true) == 0) { XmlNodeList nd = doc.SelectNodes("//page[@uri='/']/link"); if(nd.Count != 0) _request_uri = "/"; } XmlNodeList nodes = doc.SelectNodes("//page[@uri='"+_request_uri+"']/link"); if(nodes.Count == 0) nodes = doc.SelectNodes("//page[@uri='*']"); _links_page = new ArrayList(nodes.Count); for(int i=0;i<nodes.Count;i++) { XmlNode node = nodes.Item(i); _links_page.Add(node.InnerText); } } catch(Exception err) { _error = "<font color=red><b>Невозможно загрузить файл!</b>" + "<br>Exception : " + err.Message + "</font>"; Raise_error(_error); } } #endregion #region Fetch_Remote_File private string Fetch_remote_file() { string strURL = _server + _code_php + _sape_user + @"&host=" + _host + @"&charset=" + _charset + @"&as_xml=true"; _user_agent += _version; req = (HttpWebRequest) WebRequest.Create(strURL); req.UserAgent = _user_agent; HttpWebResponse resp = (HttpWebResponse) req.GetResponse(); XmlTextReader reader = new XmlTextReader(resp.GetResponseStream()); XmlDocument doc = new XmlDocument(); try { doc.Load(reader); doc.Save(_links_db_file); return Raise_error(_error); } catch(Exception err) { _error = "<font color=red><b>Файл не загружен!</b>" + "<br>Ошибка : " + err.Message + "</font>"; return Raise_error(_error); } } #endregion #region Return_Links public string Return_links(int n) { if(_links_page.Count != 0) { if(n > _links_page.Count) { n = _links_page.Count; } int i = 0; StringBuilder str = new StringBuilder(); for(;i<n;i++) { str.Append(_links_page[i]); str.Append(_links_delimiter); } _links_page.RemoveRange(0,i); return str.ToString(); } else { return " "; } } public string Return_links() { int i = _links_page.Count; return this.Return_links(i); } #endregion #region Raise_error private string Raise_error(string e) { string str = "<font color=red><b>SAPE ERROR:</b>" + "<br>" + e + "</font>"; if(_verbose) return str; else return ""; } #endregion #endregion } } |
а нафига ты файл sape.php переименовал в SAPE.cs ???
|
ы
он был переименован
|
Часовой пояс GMT +3, время: 14:24. |
Работает на vBulletin® версия 3.8.7.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Перевод: zCarot
SAPE.RU — система купли-продажи ссылок с главных и внутренних страниц сайтов.