Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: request about adding new function in administration form  (Read 1290 times)

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
request about adding new function in administration form
« on: October 13, 2011, 03:07:53 AM »

hi guys, how you doing in this days.
        this post it aims to thank all members and to request about a case.

i have two pages php, first i called it index.php and the second; index_more_addition.php
now in this last i have some addition, which i want to display it whenever i want, means, normaly the home Page is (index.php) but some time i want

(index_more_addition.php) to be the Home page; i know guys, we can do that with htacces (redirecton) file but, i find it more complicated and it waste the time (open ftp and change the name of the second page to (index.php) and (index.php) should edit the name to another)

but i want to do that with a sample way, just from the adminstration.
could some one please explain how to do that or just to give me the main ways,

thanks, and i wish you get karma for this work; if it's possible
« Last Edit: October 13, 2011, 03:11:06 AM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: request about adding new function in administration form
« Reply #1 on: October 13, 2011, 04:58:30 AM »

1)  You can create any number of pages in sNews Admin.
2)  You can choose any page to be displayed on Home... and change it any time you want from the Admin.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: request about adding new function in administration form
« Reply #2 on: October 13, 2011, 06:40:19 PM »

1)  You can create any number of pages in sNews Admin.
yes,i know snews cms; allows us to create more pages, which include php main; it can edited from the administration.
but i mean creating new page (.php)  include more additions like ( content slider, jquery poll ....& some other codes php-javascript maybe with onther style template of Homepage)
Quote
2)  You can choose any page to be displayed on Home... and change it any time you want from the Admin.
the answer linked with the first one's case;
« Last Edit: October 13, 2011, 06:41:55 PM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: request about adding new function in administration form
« Reply #3 on: October 14, 2011, 10:30:52 PM »

but i mean creating new page (.php)  include more additions like ( content slider, jquery poll ....& some other codes php-javascript maybe with onther style template of Homepage)

I am not sure what you mean. sNews is designed to work with one index.php file which serves as the site's template, and the function name-tags used in the file bring in the content to the various locations - side-bar, header, footer, etc. - within the template.

If you want to add different templates, then you might want to use Bakercad's Switcherizer2 Mods which will allow you to assign different templates to different pages and categories. Each template can then have different functions - customized functions you would create and have in another .php file (included into the template file using it) called into it than may be used in the main default template.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: request about adding new function in administration form
« Reply #4 on: October 16, 2011, 02:15:35 AM »

yes that's  what I meant, usually ( if we have a different template form that means we have onther php file index except if we want to change the color page)  this contrary with what you mentioned,
my goal from this new php page to be controled by administration form not ftp Prog, is to have more function with a different template, we show it whenever we want.

To be frank with you; i want to show/hide HTML elements using some function, to display it in Homepage; whenever i want, just from the administration panel.
i thought in three solutions could be possible
1) " show and hide table when somebody click on radio button"  but without sombody i want to do that (admin) from the PANEL.
2) add variable echo 'include elements html (divs-table-tds) in function forth_extra, this last, i put it in index.php it display those elements and of course the content of the extra, so with thatn, we can have ability to show/hide the extra,
3) (in condition if the extra accept javascript/php echos plus html) i can simpley put extra echo php in index.php which bring the content of this extra and put the elements inside it.

this is a simply code with two radios botton hide/display the content; by clicking on the radio botton.

 
Code: [Select]
<script language="javascript">
function toggle() {
var ele = document.getElementById("toggleText");
var text = document.getElementById("displayText");
if(ele.style.display == "block") {
     ele.style.display = "none";
text.innerHTML = "show";
   }
else {
ele.style.display = "block";
text.innerHTML = "hide";
}
}
</script>
<a id="displayText" href="javascript:toggle();">show</a> <== click Here
<div id="toggleText" style="display: none"><h1>peek-a-boo</h1></div>

 Is there an elegant way to achieve this; but the radio botton would be in the administration panel and the content in the index page
thanks doug; for you interest in request, i'm glad to have a opportunities to discuss with u ;) ;)
« Last Edit: October 16, 2011, 12:35:49 PM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: request about adding new function in administration form
« Reply #5 on: October 16, 2011, 02:43:00 PM »

hold on, there is a good news i follow the third solution and it goes great, now i cant show elments in index.php just with echo extra_six php.
Logged
“Fifty years of programming language research, and we end up with C++?”

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: request about adding new function in administration form
« Reply #6 on: October 16, 2011, 05:25:50 PM »

WordPress uses a "Widgets" panel in its administration system. It lists all of the Widgets that are available. The admin can drag & drop them into a side-bar area to the right so they will be visible in the side-bar of your website. Examples of Widgets are - a list of links to pages, a list of categories, members, groups, a calendar, etc.

Putting a Widget into the side-bar from this administration panel is very similar to what you would like to do - basically being able to add or remove function-tags that will be used in the side-bar of the website template.

I am not sure how W-P Widgets system works but a similar, simpler system would be nice to have for sNews... this might be a worthwhile mod for someone (who has the time) to work on.

Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

nukpana

  • Hero Member
  • *****
  • Karma: 71
  • Posts: 663
Re: request about adding new function in administration form
« Reply #7 on: October 17, 2011, 04:09:01 AM »

Why not use the extras function?  You may have to do some hacking for it to work on the home page, but it sounds like what you want.
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: request about adding new function in administration form
« Reply #8 on: October 18, 2011, 03:26:26 PM »

Why not use the extras function?  You may have to do some hacking for it to work on the home page, but it sounds like what you want.

Of course. And if you have Philmoz's old function inserting mod installed, you can then use it to inser function-names into your content textarea. It uses a pop-up to insert the function-name and any parameters (if required). An example is if you wanted to have the contact form show up in another page or article, you would use this to generate the contact form in your article or page - [func]contact:|:[/func]

See Function Insert in Articles - 1.6 Mods
« Last Edit: October 18, 2011, 03:29:50 PM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: request about adding new function in administration form
« Reply #9 on: October 18, 2011, 10:26:04 PM »

Quote
Why not use the extras function?
yeah nukpana;  i'am using it now ,i have 6 extras in my snews.
now all what i have to do to achieve this, is just put php echo extra_forth in my index.php file
than it call the contents elements of the extra.
and when i want to hide the content of extra from my page, i just have to remove those elements from the extra_forth textarea

Quote
Of course. And if you have Philmoz's old function inserting mod installed, you can then use it to inser function-names into your content textarea. It uses a pop-up to insert the function-name and any parameters (if required). An example is if you wanted to have the contact form show up in another page or article, you would use this to generate the contact form in your article or page - [func]contact:|:[/func]
i dont think  [/func]  will be able to do what i want.
func is a simple function which allow elements to display under extras  / thats all/ but i wanted to hide/display the content
now i found the solution just with a sample way.
« Last Edit: October 18, 2011, 10:29:05 PM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”