|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////# O' V, H6 w; q5 n1 c! ~2 \
// Theme Option5 q4 M$ g/ y. O7 @: d- v$ z
////////////////////////////////////////////////////////////////////////////////
: ~7 G$ O/ w4 ]$ A/ j$ s o w- G! S" a) E: n
$themename = "Zenx";
, U4 E0 P7 w- k+ K! K7 @7 K$shortname = str_replace(' ', '_', strtolower($themename));; i, |' F$ N# V3 q
# p: j+ p( \" R O2 \function get_theme_option($option)
9 a: C% H7 {3 {{4 F" A5 } B- a- h. c2 s& z- J0 `
global $shortname;+ a/ i/ m0 F' W4 Z- J
return stripslashes(get_option($shortname . '_' . $option));6 b1 D+ W% ]- y5 ]2 G
}2 ^. D/ j- g4 `. u" i/ c+ r
* Y; g. C$ Q4 s3 y( h
function get_theme_settings($option), }8 R' `+ l. E; s: {
{: | M5 D# O6 u) W
return stripslashes(get_option($option));' V4 e& o+ L/ E* `5 `
}
; j b# c! U7 ]' H- j# z6 \$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");% W" v% o D, g0 F4 T% u9 j
$wp_getcat = array();7 x+ s! x# A. u2 w
foreach ($wp_dropdown_rd_admin as $category_list) {8 G% ?1 ]( X8 n4 L& X
$wp_getcat[$category_list->term_id] = $category_list->name;
. f& \, F* a* z, d1 j) `+ [/ s6 P6 r}
4 m' l+ e' p6 S( J1 E$ x( |/ N ?, b$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
; W# u& s# ~ V. G$ l. b0 i$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");* @ P+ C# {& b9 E. H
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
0 i- ^/ s h* X0 k' m$ O
, i& k- i2 O) c% ^! A$options = array (
& P! ~# L; W/ d X( s5 m6 W
9 E( Z, G1 D! l0 R M; H
+ \2 d, o$ J. G- A* _ array( "name" => "Blog Header Settings",
5 X ~6 @! R: ~; P "type" => "heading",' i9 `. G! `4 ^, ?
),
( d7 L+ R* |9 c6 L
1 Y- s, L( v: b( P* p array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
* @3 o/ W$ N9 w- T5 P4 W6 z) X- C "id" => $shortname."_header_logo_activate",
& \; h0 k& P+ C: i "type" => "select",
! r( l' l# F" Z! v% n& @ "std" => "No",
4 J4 s7 m: B' \5 P V, n% K, R "options" => array("No", "Yes")),' h) \9 @, r% R9 m% G. v- c2 p. ~/ X
& m& B& n/ i/ B. q, i/ f5 q array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",' L0 x0 I' Z& l% w" p7 x; k: U8 G
"id" => $shortname."_logo_url",
1 J( |$ u5 z% N; g! R" C8 Q: R "type" => "text",
$ e9 f/ ~" D3 `/ T "box" => "social",
3 \/ n0 u- l7 O4 g "std" => "",' a& B& R$ ]3 y, E8 o
),
/ U- ?% i: z" y& d- h ; c- {1 p* _& N1 I4 P+ k0 N
array( "name" => "Insert Header Banner HTML Code (Header)6 b W, w0 \3 C7 i9 I2 w; u
<br /><em>*Recommended Size 468 x 60</em>
. v, A+ J! U$ Q7 M( C: ~6 N8 D <br /><em>*leave blank if not use</em>",0 M- C/ u' e! v+ i P
"id" => $shortname."_header_banner",
' O" m. b8 ]8 {6 O8 a& f2 ^ "type" => "textarea",/ {) M. R X" Y' S# `
"std" => "",
+ E9 y0 t5 L( G6 F ),+ S+ b( ~3 f) y/ p% F
6 j/ |6 o5 I, s! C array( "name" => "</div></div>",3 Y l+ H: \# \- W
"type" => "close",
( }( j1 s7 |! q6 W* T" _ ),% `! ]0 z' A7 o6 a
& F( k& C0 Z; C! m& t7 }2 |& d0 Y3 Q X' h2 l5 O
array( "name" => "Header Navigation Settings"," P9 ~4 a' {3 D+ u( H
"type" => "heading",3 n0 y w7 i. G7 ?
),
$ }2 k. J8 a o, p( A7 |
2 }# z2 X; l- x# U: ~ array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
4 t9 M3 u- Z0 S8 Y. Y <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
8 ~" {6 k- c* V( M1 `. e2 z6 m <em>*Enter the page post ID number only</em><br />
1 Z) Y0 F! M6 |. _2 I5 u7 v <em>*separate by comma</em><br /> x$ V" B' Y5 w; w
<em>*Exclude pages which you don't want to show on the header navigation</em>",
/ x. [& H$ T/ ]0 U "id" => $shortname."_header_page_navigation",
o, ?% t8 G) @' ~9 d "type" => "text",% T6 m* o) l# Z; ^
"std" => "",- _* u0 V9 a1 {
),5 N5 L) m4 e6 j# s
8 Z! i( U) R- I" b array( "name" => "</div></div>",
6 P( n! o. Y D# B2 c1 B+ A5 a "type" => "close",
5 w7 D4 a' ]1 d/ V, s ),8 u+ h; _7 [ T7 h9 ~ J/ N
2 ^: { t: r1 x, H. i, K0 u4 S* ], D4 Y( P/ }' W Y
array( "name" => "Post Auto Thumbnails Settings",
, n) r! R0 o7 _5 u: O% q& { "type" => "heading",
1 Y% i+ r8 w0 B- o+ Q/ Q ),
. U. v) N5 p' `* C! `# U" I7 l
3 z7 t( _# @2 \% I' z array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) B( J# U" f7 \! ^+ P( ~ "id" => $shortname."_timthumb_activate",; N( `! c8 G) @! W" [) d
"type" => "select",
% Q/ @7 w4 S$ D) e- W "std" => "No",; B4 A3 K6 i6 s$ a; G4 i
"options" => array("No", "Yes")),
. U4 A# j% U8 }: }7 G - {! z. }0 I+ R
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
0 \& ^ P$ ~# F4 M "id" => $shortname."_timthumb_cropping",
4 Y. w ]& h/ I "type" => "select",. K Q `) V" s ?) t
"std" => "",
; v% P1 I9 U+ R. U- J, N "options" => $crop_position),; ~/ C/ I8 ?5 m0 M
& a/ q/ M0 V5 |: M) s
array( "name" => "Insert Width Of Thumbnail Image<br />
0 A% e( ?; Y9 g3 {* e! a; S <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
7 a) s4 N. w; w <em>*Leave Blank To Use Default: 250</em><br />",
+ X4 w% @) ?% c "id" => $shortname."_thumb_width",
6 q9 Z' K7 u7 y0 f( l "type" => "text",$ N1 {& s. f9 z0 O% t3 p
"std" => "",
+ S, b$ w/ {+ i- v6 J ),) h- n# o6 J6 }( s9 U" Q
/ @; d; T2 M# L( h$ u array( "name" => "Insert Height Of Thumbnail Image<br />
" t0 y! m5 V; P1 Q$ O <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
- A( _' `- Y3 C5 J. x6 C <em>*Leave Blank To Use Default: 200</em><br />",4 C! C, S ~. z' `
"id" => $shortname."_thumb_height",3 d: {6 w9 K/ m/ x
"type" => "text",7 i+ D) c8 ]( t
"std" => "",
& V6 Z0 f) ?' H1 k9 @$ n$ D ),
" Q8 ^; z' K) j6 D
% C7 [. u( s$ I* I$ T7 P array( "name" => "</div></div>",
+ Z( R$ {0 g( ]2 W+ N "type" => "close",% M+ {5 ^! h2 y
),
! Y8 R+ g; t$ L& c: T) b7 S
' y* ?' o+ P( Q% S. B6 K, ]$ G array( "name" => "Featured Content Slider Settings",
/ R! p+ X& X5 U6 M l! n8 R "type" => "heading",. p8 o4 C# J: z q7 A' G
),
$ W: S1 a8 b7 e; ?
+ Y9 H1 N$ E# L+ p! ?& Y array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",0 y: `( c' j w7 h5 F W
"id" => $shortname."_featured_activate",/ P% z. W4 R0 C- V
"type" => "select",' R Y! m: I: v, ?: \7 x9 L3 r, I
"std" => "No",
/ X2 _2 m# N/ g4 Z$ d; | "options" => array("No", "Yes")),
+ [, s8 [: m6 n6 n, n8 {: g
* c% \. d: L1 q- |
$ k6 D% L( O6 } ]) D9 v3 l t/ g) i array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
. g' \5 i+ h. S! T( _; Q) |& z "id" => $shortname."_featured_category",
1 {) }7 U0 \9 B: |; d3 B "type" => "select",
* K: r2 _" g8 S& [; g, h4 R8 q "std" => "Choose a category:",: ^9 R1 `+ s& f$ w. S, E0 v
"options" => $wp_getcat),9 B X" u, l9 k- Y+ g
: I3 c5 w6 G' K. l( z- [ array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?"," I7 {7 C4 K+ X" x% m5 \
"id" => $shortname."_featured_number",# l+ H+ Q2 B4 S- s( R# P
"type" => "select",+ g1 B: u1 W, R7 s: u
"std" => "Number of post:",
' B0 D( A$ s7 ]8 q) |$ p( n& ] "options" => $number_entries),
; i. ~1 Y- g H9 E# d$ `6 I9 e- C: u# C" R% S2 M, ]4 U1 p
array( "name" => "</div></div>",+ b) \0 m1 Q8 U+ h; \
"type" => "close",
: ?6 M2 O$ j! e; c" f2 I ),
; m ~1 \! D4 g' ^/ v 3 J* c7 y* t' j2 }; J7 l6 y) h2 c7 W
array( "name" => "Featured Category Settings",, C1 i/ H- }. G' A* R: n
"type" => "heading",* D! [; n7 W( M# u# ?6 e
),
) N% q M- [9 h2 T6 A4 y
# [+ ?; \7 y/ S0 Z; r) Q array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
$ \" |: i$ F' `: X "id" => $shortname."_featured_category_activate"," h! r8 i* M" a
"type" => "select",
: m. ?- j, F8 b R/ y "std" => "No",$ T5 p" `6 _+ W% z8 s5 T) T
"options" => array("No", "Yes")),
. q3 Q7 A9 |' l- w5 [, A p + q q ?1 w7 M; |
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
' b5 V c/ a0 B) E9 q, }- M- F# [ "id" => $shortname."_featured_category_id1",
A2 M% H' @( h; n9 K3 i "type" => "select",
& P% ^8 M: A6 C( E1 Q1 c. g "std" => "Choose a category:",
6 {9 ], C9 [ M% p "options" => $wp_getcat),+ t8 i( F( g9 ~& [" h' [
1 ~3 t+ W4 e6 m
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
, L4 ]2 i% Y2 X' ^, P/ a "id" => $shortname."_featured_number1",# g* {7 g0 y( Y! G: d
"type" => "select",
* J6 v5 O- F4 L% Q. ]% a9 L0 c "std" => "Number of post:",) i5 n. I! c* K: M# H: N# R8 T9 F& b
"options" => $number_entries),
6 n# m4 q0 q1 W' d2 O 4 {6 W/ W( k5 S! u/ q3 v- S. s0 T
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",5 X2 U! J: r2 [: F4 t& L
"id" => $shortname."_featured_category_id2",- E4 X; I9 p6 q" M, g
"type" => "select",& S# p2 c% x' k6 W' y: A0 U
"std" => "Choose a category:",
/ q' l E8 Z( G6 p% M, T "options" => $wp_getcat),
) d$ w0 ^' a* B- l( [0 l
7 Q/ n. k8 W8 J( x; t array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
; d9 h* Q7 @$ J' X# V& U. q "id" => $shortname."_featured_number2",
" x& ~9 e, u# W* ?1 G/ Y "type" => "select",
0 }/ F; ?+ ~3 v9 T "std" => "Number of post:",
2 p: r: J/ V; r& h; T' q+ {1 I "options" => $number_entries),
; \ j3 {* Q, m. F8 E. }# v4 _
) |) y1 z. s& X9 h/ O7 f
& f3 R: a' d+ H* M- i array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",9 x# D9 W) d+ S0 `% N- B3 X# [
"id" => $shortname."_featured_category_id3",
2 c E2 Z0 @+ B) p' P6 C6 Z4 L "type" => "select"," R0 o3 W' \$ J( o" G. \3 x: z
"std" => "Choose a category:",9 \8 P$ u# T6 [- p
"options" => $wp_getcat),
+ t9 F* W# B }2 R
+ F3 Z( ^+ j+ J$ P% | array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",7 j* g. \( O! W0 y; i1 m5 G& h
"id" => $shortname."_featured_number3",* T9 h0 j! v/ w3 T4 }5 c
"type" => "select",
1 v# y" M! {# A$ R2 X "std" => "Number of post:",
8 B6 g1 v; {0 `0 {) M( s "options" => $number_entries),
& G' O2 {3 n! `, n- R1 h7 X) b- Z
5 X4 b+ Y( X1 ~+ [6 Z/ J
0 Q* y6 }( h( c% m+ n array( "name" => "</div></div>",9 A9 y0 \& X3 P9 [$ H
"type" => "close"," o8 J0 Q* n9 ?* F% ?
),
% A6 v+ ?* P1 x S9 p Y+ ]4 m1 _: g0 e. b" ?" H6 e- I0 R
+ n2 `2 [/ B% b# D# r7 G1 v- X: { array( "name" => "Google Adsense & Analytics Settings",
4 Z; x, e7 d$ Y& o "type" => "heading",$ ] z, z+ a. @( _; Z
),
/ y# i: u+ K x% }
- Z7 K C4 N2 F. b: W e M! \ array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",2 H6 {: i* R% r# J( p5 X
"id" => $shortname."_adsense_loop_activate",
" q. u, z1 i5 ]- G( y/ R( l5 j "type" => "select",
]4 c0 \6 Z& w% z% g2 U "std" => "Disable",
5 A# O& m. T: a) V) I "options" => array("Disable", "Enable")),
* m( E* ^6 _5 U
6 c4 w$ T; W) F6 ] array( "name" => "Insert Google Adsense Code For Loops Here<br />
4 B+ M( r) S- l" ^# A* s4 j' v& d <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",+ q6 D5 ^# l/ `, ^
"id" => $shortname."_adsense_loop",
% b+ A8 @: Y/ A: L4 G. W3 a "type" => "textarea",% H5 A K, s- K; O H
"std" => "",5 E4 h1 m* f9 I6 T; `& ]: y/ p
),
: Z9 P- P- ]* ^. S- o# b0 H
1 W* T; F- B+ |3 c. D1 e array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
& }" [4 I' C, X$ K! G: \ "id" => $shortname."_adsense_single_activate",: |6 x' Z ^+ n1 N' E+ R. v
"type" => "select",/ y) _7 _* z0 x" i4 a- @; x
"std" => "Disable",+ r p0 m: b6 i, K
"options" => array("Disable", "Enable")),
+ H7 V/ H9 n- s/ T
' q& [( P+ D. V array( "name" => "Insert Google Adsense Code For Single Page Here<br />7 [# L8 e2 o$ x( e" Q1 i: F
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",, A, }% j) D" Y& q0 w
"id" => $shortname."_adsense_single",/ u- C6 Z& R# S+ |0 ~
"type" => "textarea",
& m( i" @) Z1 ?. n1 ?" i# E. g "std" => "",3 B. n/ c3 X7 \9 A% Q
),
) Q1 z- @$ H2 K0 P- \% H5 f- w* e8 B1 g* f7 c
* @* T# X: X( u) p# N+ z$ ^
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",9 x8 ?, ~" x5 ~2 L' M
"id" => $shortname."_google_analytics",
: }: N" T2 t/ w1 f, A "type" => "textarea",* c3 M w1 O: r$ N1 e! h, X
"std" => "",) M: S$ e" R( o2 @2 P1 J8 r
),
5 @* s. p, G0 z- k& {9 t3 Q! ]! X
$ n/ Y2 Q5 [( [. J! D0 d& G; z, v, r array( "name" => "</div></div>",& j" |. m9 @9 f0 s( d6 {- Z
"type" => "close",, J# p/ S" Z* F9 h/ M: Q, K0 D0 [1 h
),
# E- l+ R$ w) e/ V + [+ j+ _$ ]: H& ?7 W: S
5 E& O4 c* y+ }3 |/ ~/ {$ p1 { array( "name" => "AddThis Social Bookmarking Settings",
h3 t, O$ ?- _" n& x "type" => "heading"," V5 W% n+ ~' x. ]8 S$ R
),
0 j: F0 m3 Y9 E5 ?% f
; M( e! y! E% B2 v }/ B1 f- \ array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>- n/ n* e8 t+ p9 Q: ^ N
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
- Z% u) H- z" j2 \2 K& p* g$ S" G J "id" => $shortname."_addthis",
2 ?( U: I5 j, p# T$ n6 R "type" => "text",
6 u3 L8 d; P4 l "box" => "social",( w. ^/ ~ w* s- k3 _. l* x
"std" => "",
- w) l3 V1 g0 }3 S& V; l. f ),
( @8 T3 a+ P2 _: n; k
0 D/ p! i& ^6 [ array( "name" => "</div></div>",
{/ s' b& X" d* J "type" => "close",
) M# o2 Y5 C* V, T ),
% l0 q' u* C( M* K$ \) e' @5 M 8 G: q1 s! U! u
8 _% R% |/ L/ h% p1 [4 |
* Y. c* {/ w8 c& _ array( "name" => "YouTube Video Settings",* T# A8 I8 K: d/ c
"type" => "heading",' h2 c( E/ f, _8 Y$ |
),
% h1 L/ K* l$ g9 h# e7 {( a; _ P! r& y( ~* y1 _$ w! G8 l
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",3 d3 t- ~; \$ J3 f7 `# o- K* i
"id" => $shortname."_emvideo_activate",- e1 S& G; m' M
"type" => "select",
* N. i5 s* x& I "std" => "No",
' V6 O+ [' u) e1 h- c; |6 n/ E "options" => array("No", "Yes")),
1 Z0 W# V; q5 o8 B3 n d0 ]4 J2 |% e: S: @( X9 ]6 g
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
% T- {! W7 S& e4 v3 d: Z "id" => $shortname."_emvideo",
9 o/ [! D3 D) H+ S. W, v$ B "std" => "",) l2 [$ z M* l9 b
"type" => "text"),
: O5 I0 m: _5 T+ l& P# W1 I% C# [7 t* a
array( "name" => "</div></div>",
& \2 a7 N! {& o- B( d8 F- y "type" => "close",/ N3 u* x* x) u
),
" d& U; Z s$ u* V8 }0 C# P% V+ L& P
4 E/ d* c& q# {! E4 ` array( "name" => "Twitter Settings",
3 ~' X1 Z; J* K8 J: ~ "type" => "heading",' D- O0 q8 S* ?$ J
),
( C' s3 _: Z! E; C" A& P6 H5 V' m' Y( J- H" K( P% C
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",% a& a! l( R& k# J6 e. e
"id" => $shortname."_twitter_activate",
4 b$ t8 ? [" Y+ [8 J5 L "type" => "select",
- v' \( [6 p% Z "std" => "No",
, V. F2 g) r+ l( u3 i "options" => array("No", "Yes")),
& y" D$ `) I" E2 h m a; H) Q0 n5 D; ~& y
array( "name" => "Insert Your Twitter ID here$ `- h- c5 K* Y* C! K" L+ t% z1 @/ ]
<br /><em>*leave blank if not necessary</em>
) o* r. @) ^5 q! V4 ^2 R; X+ } <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
, O7 o) S4 _( Z2 _; t4 N- x8 z- Z% v "id" => $shortname."_twitter",
; i2 |7 W7 B8 P. a7 u* M "type" => "text",
$ ~$ Y4 s4 L" ]! v9 `2 ?; F "box" => "social",
$ o, l1 j9 f9 ?8 U/ F6 f "std" => "",
" t, d9 u# y( a$ D& F4 I3 X ),
* J: \" X/ M1 j" F; }, ^3 r4 N! ]! k% A' K# U( G
array( "name" => "Enter Twitter Feed Count here
0 w& M" z: u6 s3 [4 H <br /><em>*leave blank if not necessary</em>
( p# P/ L/ x( x' ~6 x. s$ Y/ h <br /><em>*Enter How Many Twitter Feed To Display</em>",
" R+ O( I! c% d "id" => $shortname."_twitter_count",* x) s: `6 {: |1 ^
"type" => "text",0 V$ |. t% Z2 M: k7 L5 q
"box" => "social",* l5 _$ M# `8 G2 S: ^ i0 C! F
"std" => "",
9 S5 v D- y/ v) w% V# {! n( D ),
- }+ e- _; S0 S. z
9 L, ]! m9 T& H9 U4 F array( "name" => "</div></div>",3 m. c( Z% F U9 n
"type" => "close",
m, J; p* f3 ^" V8 {+ l ),$ L1 t& h8 g% g% x6 H6 \9 P# S
L7 N0 Q/ ^6 N
6 Z% [6 N, ?. p
array( "name" => "125 x 125 Banners Advertisement Settings",
8 {1 d! X3 Q& p "type" => "heading",
/ m+ r. G( z& L$ U, q! j ),
$ c- N+ Y& [2 y7 y$ `7 h " y1 a4 R$ v# K5 B9 B) x
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
& D5 k+ E1 e( ~5 r# C "id" => $shortname."_sponsor_activate",) c, v: |4 q n% v; l: f( o
"type" => "select",
. ^/ S1 g* Z- s7 t/ w: ~2 P "std" => "No",: r1 X& \9 l) H1 { c& z, K2 S2 s
"options" => array("No", "Yes")),
8 P% D! q$ l3 M 5 R1 L' ?' B( Y' P; W! _, p/ J
0 o! z$ k2 S7 p. k
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",! C! X ^, C: P; }
"id" => $shortname."_sponsor_banner_one",
+ }* ]) `$ L1 s% Q: ^- X" t" n "type" => "textarea",# X3 V. _* `) O- e1 U
"std" => "", G) c9 G, W$ B
), 2 w. O; ?$ ?: U4 Q I
* ]0 ?% N& [% m1 u8 Z, M5 K( ?- M3 e array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",, ?2 t9 F3 g2 j8 t% q
"id" => $shortname."_sponsor_banner_two",
8 i2 [3 q! c: z$ e "type" => "textarea",
$ Y) ?( m& _) A0 D5 L# n "std" => "",
6 ]5 L! A- }" B' G; f3 K% L ),
: Y# t6 c8 N1 j Z0 n
0 r) r( J! a z1 e) e array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",( @3 U" G0 c6 |' ]4 h
"id" => $shortname."_sponsor_banner_three",8 D+ E" _' R# m ]2 }- G! u# ]
"type" => "textarea",
2 m/ U2 W" X \& m: R. V "std" => "",
: v$ \: s4 ^1 I" L9 y# q ),
) V/ u' N' s+ ?: I5 o5 |5 }8 ^0 ^# E Q7 D" M( M
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
: a3 N" l( F _% X "id" => $shortname."_sponsor_banner_four",% m) p4 \" @: G. r; v# a
"type" => "textarea",
* Z; l F( ]' E' c* I "std" => "",
7 T- M) S: i9 i- C! R1 v9 h% c ),. J0 _" I- V- i
" U5 d3 g/ s: e$ \, @6 F$ M s array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
; g* j% `' G' [. {+ ?# \ "id" => $shortname."_sponsor_banner_five",/ N) Y, Q. U7 P7 @9 Y0 E
"type" => "textarea",' e" T; l: i$ X% D
"std" => "",; E. j# P' {/ h
),
/ ?3 R. a7 ]" ^ h
W5 @( H( L* m( I array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
. k6 a1 B6 D) Z% }* O/ Z8 F0 f "id" => $shortname."_sponsor_banner_six",! O0 T* O" }" _) M, ?, Q5 ?
"type" => "textarea",( ~, S0 H3 O; d' f
"std" => "",% c. c; f' B1 }2 W6 _. D1 C
),- h* `0 g; r- \+ ^) h8 ?5 q5 k
+ Q1 W; K9 R" a2 x+ p' U array( "name" => "</div></div>",! C* T% P7 }) G q
"type" => "close",6 Y. ~% F6 }$ u7 p* J. Q% A
),
4 \ M+ U8 {# W# O6 n. c" O1 I: e1 Q' U% ~
$ g! m) g1 d$ O
2 |9 A9 j2 \ k);
+ U: ]5 J2 R B6 L$ I
8 r6 U& h4 e1 ]- }function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {' e4 i6 }, R; ]: o7 e6 I/ v+ [
- m! k5 `+ O2 p7 S7 p8 g
echo "<div id=\"admin-options\"> ";
3 {$ \% y E z D1 N9 ^
9 p, e( c( \+ P' Cglobal $themename, $shortname, $options;
5 N2 t% H" s1 ^! B! ?2 |: rif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
@+ K* \3 [1 G- W3 c2 E& T! Hif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';7 K' g+ z; E2 g* v
?>
9 ]. o- g* J4 c* C! h& Y, N0 f' q- |0 F; G) }4 | T1 W9 q
<h4><?php echo "$themename"; ?> Theme Options</h4>
. g. X# H& a0 A v3 x" N* x) B5 G( P- N) v5 \) [9 `4 c4 U
<div class="annouce">5 z u7 t/ e* w# D- A" B
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
}/ H, i' f% \6 l4 J<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>7 t7 f1 S9 Q8 g! @8 g( Q! Q, k
</div>/ L( U7 w ]3 q! ?; M' m
: ?6 c$ y( {3 t9 _, L7 h" I8 b
<form action="" method="post">' @* L- `0 \1 e! E \: |
8 b& b* c* W+ T2 Y- Z9 s2 n<?php foreach ($options as $value) { ?>
" o* D+ _ `/ v4 E
# ~1 W. \$ V7 Y v' d0 F ]<?php switch ( $value['type'] ) { case 'heading': ?> {! d) B5 ~& Z! q3 k; g
0 U; Z# Y2 S( e F<div class="get-option">
( J1 f: k+ e$ E) o% S: L+ }1 U1 |/ q) ?5 t& F- @
<h2><?php echo $value['name']; ?></h2>
) D v; j- q. S! O$ P Q- p& `4 t# F( @2 q3 S7 D Z
<div class="option-save">0 w1 X4 S, ]8 Z- W* C3 B; O- f8 ~
) H$ a$ z# F# M& t' J% D
<?php
+ s" G7 z1 o, X& abreak;, D) |/ E. |; i2 |5 N
case 'text':. u3 I0 h' M2 B1 y
?>4 u; ]1 |: a$ u# K/ o- e+ x
. x" Y8 L; p. _' c
<div class="description"><?php echo $value['name']; ?></div>
2 a* U, V9 H& @* `% f6 X<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
8 u3 a& @9 y4 k0 W
, L1 }+ I* {1 n: [! a7 l( jget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
' E+ k! E0 \( f; Y5 S
5 r+ G4 ^: i6 q& h+ u; M6 g<?php: m% ~, |2 K9 j" e
break;4 v1 f/ r4 S" L. ?
case 'select':
0 a O8 O( l2 U8 W?>5 O& w# ?; Z" f7 w
- z Q* C. a3 G! V' X<div class="description"><?php echo $value['name']; ?></div>
6 S5 F- @0 p$ y$ ^1 v<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">% @$ @% B V/ I; v
<?php foreach ($value['options'] as $option) { ?>
6 V* t$ K9 B6 g+ b) E7 S<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
5 O) p) f! ^5 G$ j: h<?php } ?>
s8 F; @) f; R t) f) S</select>) h2 l: {1 q5 W% P+ \# P
</p>
' p; O) m f# ~5 w; l8 h {! y8 ]/ L' G2 G. G/ f" P: k5 P
<?php# W5 s) K7 A) W3 i: Q+ O
break;9 ~9 {( i) H/ s& u2 @7 F7 p
case 'textarea':2 \* a* K7 b0 a6 ]' h" x& E' h
$valuex = $value['id'];) N. ^% ]) r$ ^- {) o" K5 w3 o
$valuey = stripslashes($valuex);
) n q7 q: X! H; a( J! x% T$video_code = get_settings($valuey);
; N2 k/ h: Y/ r( t& a( E! V?>
* }/ C+ K/ v B }% t9 j4 Y) |' N5 U2 {& T# f6 `
<div class="description"><?php echo $value['name']; ?></div>2 A; x7 L" ^' B) @' \# U
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }2 T) V. j d+ w3 B" o
8 h' M7 x$ @# m$ Melse { echo $value['std']; } ?></textarea></p>2 I; T R5 F, I7 H& @* a
! @. F+ f/ e; a8 d3 N0 R<?php3 ?& N. J- F0 v9 b
break;0 a2 [; f& N' l0 G# G
case 'close':2 W. g0 O( H) b, z$ q9 H
?> S- j3 D8 n4 U5 Q4 A# t; V
5 N% T# D+ H. s; ~<div class="clearfix"></div>
1 W2 m& A; l% I' c. z</div><!-- OPTION SAVE END -->
6 h0 m; w) y+ j2 j7 g! g' y2 Q/ @. z4 g
<div class="clearfix"></div>
0 l. Q+ f9 y; e; D* A7 N' T</div><!-- GET OPTION END -->
( `* o! K8 M" j0 g4 ?
4 M( w: [7 |5 i<?php6 p- `& J5 L, ]6 k# j
break; _7 s) B% t/ W3 ^% u2 g. F
default;) p. m. {- J/ m( y L# \
?>: V; H2 o' M8 M0 a. u. v! |
/ N" N9 G4 m* C; Z! h5 v$ m
( |: S( O" u- ~: ~3 B7 @
<?php+ {7 j2 l y) t1 f, _1 x& \& U
break; } ?>/ {6 |4 O- n. k# f
. j, y' G5 ^6 ~" V; _<?php } ?>* L1 G9 P1 S9 L. ]5 [ R8 l0 l8 v
8 U9 T" H$ Y" A9 t. w1 G& I
<p class="save-p">
/ N# n* x4 s4 y/ m5 e<input name="save" type="submit" class="sbutton" value="Save Options" />
3 u* z5 k4 y% Z9 j! c<input type="hidden" name="action" value="save" />& O. q) W; e% y# ]
</p>* N9 R; \+ n- K/ G" ~: L- ]
</form># S5 e' d9 ?+ F
" E w* ~, p3 @! ^1 \. t. a
<form method="post">: l) @1 \; N* f G1 L9 E
<p class="save-p">+ ?4 N; L. r7 |2 F. U* a3 A( K& H
<input name="reset" type="submit" class="sbutton" value="Reset Options" />& Z% m6 A& h& u9 L
<input type="hidden" name="action" value="reset" />
, m7 w! n! k# B& U/ e</p>6 f. R+ y3 z: h5 A/ ~' W* E
</form># k; r$ ?) G$ N* x; W
: \6 ^5 a/ w: k, `</div><!-- ADMIN OPTIONS END -->8 A& _2 O" L5 V7 W- o
; O; O8 ^7 q5 K$ S' d4 O+ ~8 ]<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
z0 y$ D8 r+ X7 t/ ^' b' s
\, x% l8 E' d( Q8 ?4 Z+ Q {, Ofunction mytheme_admin_register() {& ]: Z7 J" i( ^2 O
global $themename, $shortname, $options;9 x$ Y: i4 @; J1 u1 s
if ( $_GET['page'] == basename(__FILE__) ) {
2 l! B" } e; j" l: u bif ( 'save' == $_REQUEST['action'] ) {
4 Z) [( k" c& Pforeach ($options as $value) {0 y) q+ M& E D, G8 o
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }) [0 J( a3 a* X3 T- `
foreach ($options as $value) {
+ Z$ G/ T4 G8 a0 ~* H" ?" A6 Sif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }( _6 ] }' w* T- p; R
header("Location: themes.php?page=functions.php&saved=true");
- D0 e. @" T! a. tdie;6 K2 b- m" U( |) w( }3 \
} else if( 'reset' == $_REQUEST['action'] ) {5 j# A* @$ b2 s1 E
foreach ($options as $value) {+ \* H- ^& W/ e8 ], y0 w/ _* u0 \" e
delete_option( $value['id'] ); }
7 _* V( f$ J- W: G9 {! `header("Location: themes.php?page=functions.php&reset=true");
* T5 z) ?" u' p) b4 ]* x( i0 kdie;
7 O3 f0 C% e( m4 G2 K( k; }- B" `6 f}
$ R* L2 p3 F& D8 q/ ?} J# y/ \( C& D8 H5 z0 Z
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
' Z9 k& Y9 B& s8 m, f}! \4 z h8 j y4 S3 J4 b! N8 b
; ^- G; |0 i9 x5 k5 Ofunction mytheme_admin_head() { ?>, R7 S: f. y, m u
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
$ Y0 ^) p% s- l% h! N+ \* W<?php }
/ m/ N& \8 r; E4 [4 R% R |
|