|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////4 W3 }; c* F7 k5 W2 G9 V
// Theme Option
- h/ S4 ~$ E4 \$ t9 m* r1 G////////////////////////////////////////////////////////////////////////////////0 d8 L& b; |0 T: D/ j0 x# z
, I# J0 K2 A5 W* [9 w! ?
$themename = "Zenx";
9 O8 f4 \) I. ?/ ?8 K. {! j q2 t$shortname = str_replace(' ', '_', strtolower($themename));
9 Y% R) b9 Q( K( @4 w' o0 V$ n7 [# b8 ?0 d
function get_theme_option($option)
' k, l0 O3 {; i1 k{
p7 s- n! B9 k) x1 o global $shortname;
1 S) w# [) r9 U. e s1 R return stripslashes(get_option($shortname . '_' . $option));+ I0 ?3 ]! d8 [$ i6 S0 V3 m+ ^/ P
}+ R9 P, ]: `0 {; `/ e1 H9 i
& M# b1 A3 B; e) ~function get_theme_settings($option)! s7 N' r4 w% K$ N
{
' E. {4 H' B" o7 d; q return stripslashes(get_option($option));: Y- M: m& ^: E3 L
}
5 v7 W" _# G$ b' {$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");( j; |+ [+ [" s! p, K: a' s# I& _4 a
$wp_getcat = array(); Z3 Y1 y: i& b1 ^
foreach ($wp_dropdown_rd_admin as $category_list) {+ Q* I3 L- ~ z0 Y5 s: D5 P7 a& y
$wp_getcat[$category_list->term_id] = $category_list->name;
2 @( f) B: I5 J* a}
. ^% y; X) g5 A- K# ?( |- ~2 }$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
3 T- H/ F- T) ?1 u- Z4 E$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
- \; N. ]# f8 E4 a$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
: [4 Z/ L6 s6 p2 a" R: a4 r3 Y' Z
9 D+ F1 }9 c! e2 A; d$options = array (
% u7 C- o2 S7 v) \/ g" O5 a1 i V0 m4 X+ `' m# R8 m
) o M- M/ K6 k& H
array( "name" => "Blog Header Settings",
/ A% P; U0 H' o7 ]1 l4 G) e "type" => "heading",
7 v% i# U C+ @4 p @/ D. P ),/ C0 j7 f9 ^& U/ I6 F! o
7 e" _; W! ~& c5 F% c array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",& G/ U: \1 I! c0 Q' e" u8 q* \
"id" => $shortname."_header_logo_activate",) x. H+ [+ ^ |* n5 \8 P- `9 s
"type" => "select",
9 |2 v0 M7 _. @: I5 d2 n2 o "std" => "No",& H% E7 Q; `4 M& |2 Y; y" r# N
"options" => array("No", "Yes")),
$ g) h) o6 |2 U4 v! u$ @! B. b/ D: L- M* @1 M
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
: s$ w( ~/ a/ ?8 @/ ^2 U `/ o "id" => $shortname."_logo_url",9 u6 u/ t7 Z0 O( |
"type" => "text",
0 b, @# e& d) V- D3 j "box" => "social",3 c. Y) |3 M7 C
"std" => "",
& v/ R- E3 _9 s# F ),
* k% [0 S% h7 l+ h* @+ m# [ ( |" E! b$ `8 T( K
array( "name" => "Insert Header Banner HTML Code (Header)
& Q( {# {: R4 \4 u. K6 q; ] <br /><em>*Recommended Size 468 x 60</em>( H V$ _% Q% c' b5 [
<br /><em>*leave blank if not use</em>",
- I# j: ?7 J' ^1 s5 Y ` "id" => $shortname."_header_banner",& I& r) h: }7 u+ S5 O
"type" => "textarea",1 g* d2 C0 c+ k& S& T9 y
"std" => "",/ p, z# s }9 h! O, i
),! L1 h& V- ^% R4 Y1 K+ K* g; d
* |# C" F% v2 s0 J
array( "name" => "</div></div>",
# C1 Z+ n, A+ V; o6 C- Y "type" => "close",, ?4 z) H5 {% [
),
6 X8 _5 {; m( [
) |4 [3 b, ^8 Q6 R
5 Z. @6 m2 I4 b2 `' X array( "name" => "Header Navigation Settings",
. f3 K" [+ Z5 r8 b8 i9 r "type" => "heading",; ~3 W- b3 t3 m$ Y
),
1 G' W/ Q3 V/ b" `2 @0 T
, T1 J$ [8 ]' s0 t9 n, t& K array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
' \' _; K% h" d6 [& d% h5 x <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
* `. z2 t8 I7 r <em>*Enter the page post ID number only</em><br />9 @2 B* S M: \+ ?' ~# {$ v, U/ @
<em>*separate by comma</em><br />
' B8 O2 d* B H# a. i <em>*Exclude pages which you don't want to show on the header navigation</em>",* S5 i, z! H' F8 W( l
"id" => $shortname."_header_page_navigation", ]$ c/ m2 m0 |( v5 `
"type" => "text",
) R5 I5 u% J- J m, d" d6 k "std" => "",
( { Y% a+ f; H5 n ),
I* d( \! Q( q. ~% Z4 b7 e1 R
u; x) H1 c# _+ Q% z array( "name" => "</div></div>",
4 Z3 ]; a4 w) e8 w "type" => "close",5 y' d' d# \% Y1 s
),/ T4 s7 L( ~0 |
7 u8 }3 Z! x' P! `
% S$ ^5 F) c6 t5 q$ K6 T( e) N0 B array( "name" => "Post Auto Thumbnails Settings",* S, N1 S8 |, C) o9 y8 r
"type" => "heading",0 I- U" { W3 N3 ~( |
),' q' T1 J1 g# s2 [5 F
* A6 J; g* |* M5 F' j9 V0 ?2 _ array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",/ `2 z7 n8 P. ?
"id" => $shortname."_timthumb_activate",
& |8 R; A, w' L# w+ X "type" => "select",
' o# o) p0 ?, W. R "std" => "No",! s/ [ _+ P% b, o _8 J. ?& _
"options" => array("No", "Yes")),7 |: B' g( t% ^. f5 X
+ a O Q0 p, O
array( "name" => "If Timthumb is enabled, Please choose its cropping method",$ i! Y- ]: f) c6 \8 u( K2 _% J8 a
"id" => $shortname."_timthumb_cropping",) D; D1 ^! d( `% A4 x6 V; s
"type" => "select",
3 x+ f8 S7 B$ `' h "std" => "",
2 s7 S1 f6 T1 {; X0 j "options" => $crop_position),
1 @) V4 P' U6 M' P6 H6 d1 N4 G& U4 I M' Q3 Y# S
array( "name" => "Insert Width Of Thumbnail Image<br />
E4 {, ]( Q @& a' \- e) V( ` <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
$ x1 x. ?& J# q* k# Q <em>*Leave Blank To Use Default: 250</em><br />",
3 ]9 ?/ y$ H7 d1 i! ? "id" => $shortname."_thumb_width",
5 {6 I1 d8 h! }( \& A "type" => "text",
9 q' G8 [+ l" M: G+ q "std" => "",
- m, N: p0 v, \' r, t7 t. f ),% O7 f& t% S" U/ u2 u0 j+ i
- \" x6 N: O, o4 E" c7 m
array( "name" => "Insert Height Of Thumbnail Image<br />
" S. ?( y# C; C0 v) r+ ?0 @9 [ <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />/ \& F8 J- U \1 _. ?( O
<em>*Leave Blank To Use Default: 200</em><br />",
3 d7 u% i+ v3 ^5 x* h' U# \% a "id" => $shortname."_thumb_height",
! k+ j* ?" o" J! L "type" => "text",% I" g5 x, A7 [0 B7 Q3 J' J
"std" => "",( A0 E3 f; @) X) w5 z
),
# G! S0 G1 p5 r) j0 R
+ l3 n c# @) p( m v( n+ o' A( i array( "name" => "</div></div>",6 c8 [$ Z" _3 g# o5 v
"type" => "close",7 U& B7 |( ^# h7 \# d( v
),, Z" ]$ {! r& W+ B9 \& `, V; R
. M8 W7 m! {# [ array( "name" => "Featured Content Slider Settings",
4 S8 c# h3 g% c6 F2 B "type" => "heading",2 u) r2 N, B6 L9 c
),
4 W7 M. o, `8 g6 @( Z# S! S' E/ e
& p% m# N- S; @( L3 o- J' _/ e array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",1 |# [, v' C: n j# t
"id" => $shortname."_featured_activate",4 s. V$ I+ r3 Q: [% m6 k0 \) \
"type" => "select",' h, J5 T/ R; _) G6 C
"std" => "No",2 \' v& A8 R0 T
"options" => array("No", "Yes")),5 o/ u- j. C9 h* M! I) L
% m7 m/ a: o4 C5 t) u4 t6 i3 H) Q& X. K4 E1 ^1 \+ J. A+ V) y
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
W/ Q, N* b Y# b) H "id" => $shortname."_featured_category",& Z8 J. \! Z L0 Z. H
"type" => "select"," w% C* ~. O! R4 T$ i& i
"std" => "Choose a category:"," y$ y. i3 E* N; A' l
"options" => $wp_getcat),/ p/ t# U7 E9 R' E. A" J/ Y! s4 Y& h
; ?( Q. w8 s! { array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
& N: Y n8 b/ Y8 q. p4 b' g "id" => $shortname."_featured_number",
! m/ m, Z; j- w6 z ] "type" => "select",8 X2 F( |1 c1 }9 q' r5 J7 B: O5 U
"std" => "Number of post:",
, P9 E2 B9 O6 U8 g' L' q' a- J "options" => $number_entries),
# }& Q) S! W: _/ Q; @3 o1 G; Q4 G* h! F
array( "name" => "</div></div>",! o% M4 ^- A# \* k3 ?) `, b4 ^9 A
"type" => "close",
5 J- m3 v" G7 \6 D6 M ),
( A2 F! B: L1 Q! T, ]; a8 W
0 s# |; R+ V8 k: d% | array( "name" => "Featured Category Settings",
7 X. o, [% @1 W2 h) u# H "type" => "heading",% I1 Q( j8 g/ H0 D7 }2 v
),
' G C3 a+ T& W% V. ?4 L: J9 z9 Q& d9 h6 B( ~7 v
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",9 K- K0 S6 b/ o7 P/ p: ^6 N2 N
"id" => $shortname."_featured_category_activate",2 L4 N; F7 R2 C
"type" => "select",
! Q A/ k. v5 R% v7 T "std" => "No",' ]' B, J4 \" i
"options" => array("No", "Yes")),
& z- ?! p0 ~) m$ U8 j; w
- X# ?! r+ G: j4 h' U3 U array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",* a/ t4 |6 |4 H, t5 J5 }2 ` g
"id" => $shortname."_featured_category_id1",
5 p7 a# z! x) K4 B& y' @ e0 U "type" => "select",
7 y/ Q, t6 {+ ]6 M4 Q `0 i "std" => "Choose a category:",
+ j1 S/ x& B. w% G9 T5 e "options" => $wp_getcat),1 z" m( ]! L6 h( r# f9 q l. @) s
# G- [. e3 T$ S9 n# i1 q array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
! k# L9 S+ j- t- h1 a; ^4 \; C G9 X/ ^ "id" => $shortname."_featured_number1",8 X7 L. |: ?( K Z; x* U r
"type" => "select",
) k* j& |" Z1 h2 D' i ^4 `3 V$ i "std" => "Number of post:",5 A* y0 X* S- o$ p1 {3 ~
"options" => $number_entries),, t& y1 k1 u1 B
* k W! N7 I6 W7 R7 \
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
5 E* g. O$ Z+ U5 b "id" => $shortname."_featured_category_id2",+ R! n; K$ q5 `, C5 q4 B
"type" => "select",9 g( v; F" F0 G
"std" => "Choose a category:",
; t9 _& y: g) }" ?% j% W "options" => $wp_getcat),
' `# N$ v6 x( ]) n0 O : t J6 g7 Z2 i& L
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
6 d* ]/ V1 T% `6 Z! C# ` "id" => $shortname."_featured_number2",
7 @* x9 ?' e2 v2 O "type" => "select", Y) l# i6 S( |! f
"std" => "Number of post:",
0 L' U X! D# [- \ "options" => $number_entries),3 R0 |% z6 U V2 J
" g; p0 [" a$ w8 ?" I" |' {$ S4 P; }
4 Y% b% h5 D( ^. `* t3 F7 Q array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",0 u5 D3 D& x$ S/ S* l
"id" => $shortname."_featured_category_id3",
: p/ K( I/ F1 t6 J "type" => "select",
5 K* ~& `% f* x' L8 V' P "std" => "Choose a category:",/ R1 A+ s( t, U. T
"options" => $wp_getcat),6 E1 ` v0 \1 g5 ]- B
A R' B. R3 b
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",# v) V+ I, J: m! J6 T
"id" => $shortname."_featured_number3",+ C$ `2 w R/ L- p
"type" => "select",8 S" o1 H# q; ?: o5 M6 g
"std" => "Number of post:",
6 {& Y! |- I/ p u- c "options" => $number_entries),
; F' M, H& Y) P2 L8 \, @0 b6 t6 Z3 P& A* `, C% x- f' M0 l
6 G% V1 D9 r, e) B: Q2 y
array( "name" => "</div></div>",
: J# [. j+ o1 j6 n( s' I "type" => "close",
& X( ?; s7 T5 o- i$ z9 ^ ),
6 X3 }1 Y- s c+ m( R/ @. Y
6 ^, o9 A/ {- c2 H% h2 _, ~* c0 V1 W; E4 p
array( "name" => "Google Adsense & Analytics Settings",
6 D1 A+ i) R1 W2 I# [ "type" => "heading",
: l4 k8 n6 j% E ),: k3 i$ `5 R+ ~# C+ M9 m
# E" t3 Q y, q+ n0 n9 m( `
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",# X: \. e: @$ S A" x+ O/ X
"id" => $shortname."_adsense_loop_activate",
' M9 e1 D: @: H) _7 [ "type" => "select",
' W5 `4 h: A+ ~7 b; L0 O V9 W "std" => "Disable",. n3 l9 b. }; N) M! C7 v6 J: ~
"options" => array("Disable", "Enable")),
. c# p3 x9 _: {6 Y% ^& g$ W) m
* b+ [+ b. r0 l5 P& O array( "name" => "Insert Google Adsense Code For Loops Here<br />0 o1 v# e/ K' ~6 N; u
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",% I% `+ q5 d6 ]# M e& {
"id" => $shortname."_adsense_loop",
* d2 o) H# r' u8 ~ "type" => "textarea",0 ~9 V+ r* X1 M+ N, m
"std" => "",6 y* R8 F" B8 D/ c1 \" h$ X
),
6 m$ C5 D, M( w7 l) E5 S d* C# j; U9 r# p
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
& ]6 g8 z- q( G" k' k "id" => $shortname."_adsense_single_activate",, B V# n) V" Y( F4 g
"type" => "select",
2 [9 M8 d. O0 R/ W9 i6 p "std" => "Disable",
6 F1 A. Q% j$ T) T5 k2 j( r "options" => array("Disable", "Enable")),
3 s8 z: q& O2 n$ U. M7 h* L+ h9 M( \8 c
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
& g6 G+ n; D! D$ Z* ^ <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
% C% i! F9 t4 s% j2 L1 E: g: j "id" => $shortname."_adsense_single",
, z5 K! V) Y4 d6 A8 }( v( m "type" => "textarea",
9 L( l) K% F( m1 T, T" k6 p0 N1 A "std" => "",
& Y) o: k7 Y7 H4 U ),
$ Y+ ^7 t% W8 z# i
+ M! N% b5 S1 A9 d' m) m# g# _6 ?- ?! Y2 i/ P( f! Q7 p! |
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
5 G$ }" {8 S7 W" e "id" => $shortname."_google_analytics",
3 A7 i. d" L+ r; I. ~( w" } "type" => "textarea"," p! f: j6 @3 P* ]! i8 a$ U# F
"std" => "",* ]9 o' c3 G9 v( o
),
' j: h1 R2 i, h' ~$ a* O
3 q: f- ^2 ?2 V array( "name" => "</div></div>",, i0 c' h( l( Q, c
"type" => "close",
) i8 L7 u$ v! H3 v# V( b ),5 S8 U1 V4 `# l- ~: `! D
8 e! M5 [8 l1 _& D5 i8 W/ c
6 r H, J# T; x" U
array( "name" => "AddThis Social Bookmarking Settings",
/ b' B3 j! u& _ "type" => "heading",
. _3 T& K8 e3 I1 N, V1 | ),+ u( j: V Y9 }+ l
' B5 b U# @6 x0 v4 F7 W' u* A array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>! Y A7 e& n: i9 e2 W* i
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
% G% ?# h; _# ?1 r$ b$ R: {" r "id" => $shortname."_addthis",8 [/ N0 e6 d; W+ l" W* d2 M, k
"type" => "text",
- j* M; V$ x( j- l" n' n "box" => "social",5 X9 T D" ~) C4 P- v4 p1 |- ^+ [" I
"std" => "",. b& A, b, T$ V! K) T- O* t0 I
)," J. F8 t0 ?4 e' V1 v
7 ]6 h% t. X. i- j array( "name" => "</div></div>", f/ d" O1 H3 `5 s `2 K: \5 n+ z
"type" => "close",
; d$ z) [, |1 u I) p. n ),
+ t4 ^8 O1 ^. e " G- c1 |9 I# h
" K0 U5 w+ V: |& q: `& p# k& {/ h
& u" x9 X C l: Y, ^ array( "name" => "YouTube Video Settings",
( e `: \0 t' i( W; @ "type" => "heading",
9 }8 G+ S$ m3 O. G, u+ m$ H ),- c+ L2 F5 z, }0 |5 t# o- w7 B
$ M; L. X l" p z9 k" M% o
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",! k9 v$ _8 l4 s: D! Q. c8 Z
"id" => $shortname."_emvideo_activate",: B* t- E' W2 k7 V
"type" => "select",! v2 [2 @7 d5 S. _9 U
"std" => "No",# E, t- k3 \' d) \. u- f
"options" => array("No", "Yes")),* A- ~9 A1 Q( `% g4 ?
: v7 N- M! L8 [, [
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>",
G) `, G# s. Q7 {) d: u: F "id" => $shortname."_emvideo",
# @1 N' H& K8 D( U "std" => "",
( l: l, Q, C' ~$ y& R1 X "type" => "text"),
+ q8 C+ a$ D" H6 f* N) b4 E- C
% @& I0 @, v3 t' G9 } array( "name" => "</div></div>",
( s) W& s5 L0 f# } "type" => "close",
$ _0 @0 D# H+ X) Y+ x7 S ),
4 W! W9 `( T, u1 T2 v
" B5 y. T+ S8 D5 P array( "name" => "Twitter Settings",
! B) k% z# h) [& M/ e) [ "type" => "heading",, @9 X' d+ ^# @( H& b
),
& B4 O- x Z- ~8 \: J" S1 j" \, O6 s0 V* Q' }/ M, B
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
" Z% u9 v3 Y. G. ]3 j) W/ f1 v" O "id" => $shortname."_twitter_activate",
. Q. T8 o2 ] V- J: h4 ? "type" => "select",
4 s1 `% U& ^, B$ t3 e! O3 a "std" => "No",; z* U X0 [6 ]" i+ Z: f$ I0 f
"options" => array("No", "Yes")), P% F' @2 e) o( C+ z
5 J1 ~6 y: u8 E
array( "name" => "Insert Your Twitter ID here A! B- I* U4 [8 Q: d
<br /><em>*leave blank if not necessary</em> `7 v1 {; G9 e. h; D0 }+ `5 v N
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
# ]5 r/ }$ g' z+ [1 S "id" => $shortname."_twitter",7 [' ^& ~3 N# ]$ `$ t* m$ x* n) O$ f
"type" => "text",2 U; T) ~! H7 \9 M! ]+ b1 k# K
"box" => "social",& Y. h" }: m6 q$ y; c3 T3 z
"std" => "",
3 o6 d: Q }/ q0 ]! E# n ),2 e( @5 A6 X/ x$ k' [
) s i- R$ K. w array( "name" => "Enter Twitter Feed Count here
. j% D. G, j N$ j( D3 D% h7 C4 h <br /><em>*leave blank if not necessary</em>
- d9 f. k' b/ ?) g <br /><em>*Enter How Many Twitter Feed To Display</em>",, f& @) g" v' J0 |6 q
"id" => $shortname."_twitter_count",) Y: l9 A4 `$ n
"type" => "text",
3 }% E3 f- s- m* F4 ` "box" => "social",
' |3 p" H5 c. m, K* B "std" => "",9 N) S' t; O5 Z2 _9 x7 S: |+ V
),7 l2 `# Y) n+ f
$ a2 F- w, V$ N3 N- F& x4 K) f3 U array( "name" => "</div></div>",1 C) V$ `7 {% k8 W& x7 U, F {
"type" => "close",
% _8 m0 d8 l( l' N3 a# b- i ),
8 _+ e9 ^3 T: [% ^4 m5 m6 [5 z
/ J& J0 P1 X' J6 L+ v# g: C2 D9 q3 d L1 O
array( "name" => "125 x 125 Banners Advertisement Settings",
" Q+ L1 S3 k1 l% a "type" => "heading",- b: w. D; q H' z, Q& h0 N/ Q! r6 k
),! X, H2 x x4 D6 j9 C# `
; ?+ r1 ^5 A) b+ k0 u
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% y$ A9 Q- q. M! f4 B I "id" => $shortname."_sponsor_activate",
- ~& W% e+ q7 ? "type" => "select",
1 d! Q! r6 \ K' _- R: \ "std" => "No",
5 c" n0 }. _/ n. Z "options" => array("No", "Yes")),- |6 ]2 c5 _1 q" Z( n; ]) S* d
4 s: O% i" N( V# e9 n
8 Z4 d4 Z" U7 M# _ array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
, A# [5 N, ^: l+ Y% y% ~. N, P "id" => $shortname."_sponsor_banner_one",4 w' X: f# U# {7 A2 d1 r
"type" => "textarea",1 _+ @5 E( p; @0 t5 u, X: o$ k8 H
"std" => "",. l# q' ?* L/ C/ r& g z& O
),
3 R4 T8 B6 I3 l* A/ k& T
; y* }& C0 Y* r" I# {& O array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",$ Q* `$ p7 ?: A! ?% i# M: {
"id" => $shortname."_sponsor_banner_two",1 z% Z' v& J7 T7 N) D
"type" => "textarea",( _: Z( w! R9 d$ n, V: Q
"std" => "",9 I- ]3 H u" I9 g) C6 M/ T/ a9 k! X: l
),
8 M5 X0 e6 |8 H6 t$ B9 v, k# Z9 e: p. k6 Y6 I* @
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
+ z+ z0 h2 Y2 e* u! j3 A "id" => $shortname."_sponsor_banner_three"," `3 F/ w0 h+ {1 e2 v: F' P/ [+ [; A
"type" => "textarea",% u+ |2 f$ v5 c/ D3 Q/ c/ X
"std" => "",
! N" ~1 I" m; ]& Y# [% H( S9 t6 k) { ),
% l' x6 i9 B5 N3 U: o# \
/ K/ m& _5 O" m S: B0 K2 V. s0 q array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",! F" N/ {& Z$ u! O3 q8 n
"id" => $shortname."_sponsor_banner_four",( }/ F2 V5 e* M- T# U& i
"type" => "textarea",
! E }, {& B# i/ i "std" => "",* b+ y6 p9 B2 I5 R( j+ @
),' q% d) G" D6 {, h* X, K# j
5 p, t R1 }5 b3 h6 h' |
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",; [1 I3 U/ I# ~7 a/ w/ \
"id" => $shortname."_sponsor_banner_five",* u0 h: C, t9 G( J+ ~% @ R/ l
"type" => "textarea",- D u0 d7 ^) E7 o, _
"std" => "",5 \+ j" S: r9 j J; }- G
),
2 d1 D- C) L5 E
. W' v2 m- y6 N array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
u) ~3 `2 V( P- X1 H5 l! A "id" => $shortname."_sponsor_banner_six",
& p/ n! h- A. C6 ~# n+ S5 u "type" => "textarea",1 j# j( p M9 |6 T8 G3 s4 T5 ~8 j
"std" => "",2 t, T, [, V& b& L- ?' q% P
),
% S3 {2 A- ^: ~, m4 ~( i: N `- e+ `) T8 \* Z
array( "name" => "</div></div>",
, @/ x( h" F9 w* H "type" => "close",
, ^ ^. A" e. Z# i9 R. l ),9 x* e# X7 o: J
( K G# F9 ?% t, F5 F( \5 u! j* C( @) q7 v! W4 R
6 u4 R/ i- T$ O) z/ M$ g);4 r+ @- A; k' F5 y: r/ i: \
& O* ^, @+ N8 o7 J9 [function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
. W Y1 A: o0 Y' }9 h
2 k( [- E/ V* c" s, u8 {* techo "<div id=\"admin-options\"> ";
9 w/ v" I; U. W z' F' V2 r" R1 q' I) R+ A( G* R" q
global $themename, $shortname, $options;& i# A7 F3 i3 Y8 X7 R- Y
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
5 y5 C" \# O7 L6 ?if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
+ x: v* V1 t, L' }& F( K?>. N, I5 L! U0 u- v
}' D. w; B% D<h4><?php echo "$themename"; ?> Theme Options</h4>4 r. k/ ^9 p5 g, K# s/ }/ l
4 p4 G2 J( U v
<div class="annouce">3 ^5 F) Z! k! K: g# f
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
/ J% R h+ V0 [<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>1 y& O a0 {* k, F
</div>( c4 U5 M7 O2 ]
1 y8 d! L! T. u( L# }
<form action="" method="post">
- k5 m3 b" Y/ p4 k, W; C+ k, t$ k6 i, J- ?, v
<?php foreach ($options as $value) { ?>
3 o9 m, f, u: n' U" x5 B( q; B* `, g7 A! {) A$ Z; O! Z! w+ o, b
<?php switch ( $value['type'] ) { case 'heading': ?>
+ M& \$ P, U' v5 U, X
7 A, ?' g2 |% s0 [<div class="get-option">/ H# N3 E3 ^3 {/ s' i6 _
" R3 R. G: m& q8 |2 w
<h2><?php echo $value['name']; ?></h2>. l4 @0 D4 k; l% J L# d- T% b
- t# E2 p* a( Y% C* j# t5 H* v3 Q<div class="option-save">
$ U( Z$ S& j3 f3 h! K) U! M
' w: a; ~7 M* `# T' g<?php
5 y3 E3 J+ Y9 [' {5 G3 E( ubreak;
, f5 ` O! b0 A+ xcase 'text':6 m" q5 B9 n4 x) m
?>) G! A3 l9 t( J5 y) X
9 o: ?( N! j# i) C% F
<div class="description"><?php echo $value['name']; ?></div>
: n2 N1 a" T7 H1 q1 |: C7 m& H2 f8 k<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
: N9 q" I& F5 y9 b+ k' U! u. |/ D2 I7 t1 O7 y* \# k( [2 y
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
: N# c" Z2 D, a- d; @2 a( j. z: g' z+ s" z; |( H) g# v- ~
<?php
/ ?. ]1 A* s6 O* {: v4 obreak;, y1 Q; _8 H: \5 U% I9 _
case 'select':
" }) M3 I' z+ `1 t' a) L?>
' g7 c5 z9 B7 l! B$ U: j; _6 c4 H, u! W- ?
<div class="description"><?php echo $value['name']; ?></div>- I2 w- O- \8 \( w; r! q
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">6 H& g; [) J- m" u' o( m! K
<?php foreach ($value['options'] as $option) { ?>
0 R/ l" {9 n4 s! l! F' A8 Q* c<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>" R* n6 T' ? f- K3 P
<?php } ?>+ W0 o1 s" C- l
</select># {- L: z( B f+ z; ~+ \
</p>0 K% T5 M! N! L3 R Y1 r
4 Y5 r. k# L4 S8 K9 F* U<?php
' Q8 J1 C2 q0 dbreak;! ~3 P8 \: e& h
case 'textarea':3 E5 [! Y& [- d! K
$valuex = $value['id'];! a! t, a6 F9 G4 a
$valuey = stripslashes($valuex);
9 r% ?- R* @% j$video_code = get_settings($valuey);
! W8 D9 C% Z% L) i?>! ~6 A) P. ~4 a5 W5 T
$ u" e! ]2 _9 N) Y! T$ h- R<div class="description"><?php echo $value['name']; ?></div>* i- v6 W9 D/ Y( l$ \
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }% Y. I/ D& a7 J4 R4 F) D1 J- B
% d/ w9 Q5 K$ L/ r5 p" {
else { echo $value['std']; } ?></textarea></p>" P! ~5 ~ O+ F X7 h$ \5 @
# p/ B9 O0 g& W/ x<?php
+ A& @4 w3 m( B8 n- n& Y7 ^break;
( F# {! I7 i% O! n( N( a1 xcase 'close':& O/ j( n( z) P. K
?>
9 t/ J2 {$ U% |% Y+ w% p# \4 X9 b6 v8 M- [" ?' u9 Y0 |* f" p2 m/ W f4 L6 b
<div class="clearfix"></div>; O" z5 Q: ^: r! k/ C$ b
</div><!-- OPTION SAVE END -->: O/ P4 k+ W7 c9 [( `3 F a
. X3 R/ c7 G& B3 F8 k" @<div class="clearfix"></div> ]' R4 k+ s6 S( h2 n
</div><!-- GET OPTION END -->
1 ~3 ]3 X. i& x g1 i
}4 R. S, @! ?4 C<?php
, [7 L. e6 g9 [( f* Gbreak;
' E* H7 c- \7 `% v/ _, Ndefault;: v9 ^- Y7 u, {( `% D) n' b& \
?>
' C( z/ N4 f5 s2 Y% e# Z6 Q6 W3 `5 B0 [9 G/ h
3 G' O3 I4 ~. `8 g) D<?php
9 a5 b8 U" o e, B3 kbreak; } ?>
, d7 ~+ I& _* z' ?) \& e5 ?
2 l' a% G- B/ _8 E2 H<?php } ?>: Z* y7 {# S" x
6 d# o) d3 m# C
<p class="save-p">0 l. T4 ^. C1 l* J
<input name="save" type="submit" class="sbutton" value="Save Options" />6 o0 g: D6 y$ G. N6 q( q
<input type="hidden" name="action" value="save" />
3 m ?3 X4 o7 ~9 S! Z</p>- f, f5 m9 X) o) O
</form>& t# V4 p# y8 C- g
' x* s' T H( Q<form method="post">
. k5 C& x1 x, Y( P9 Q+ s# ]$ w8 S<p class="save-p">" m/ R6 J0 t; @- ~! p1 z2 Z' S
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
- K! f* H4 e4 x/ O, a<input type="hidden" name="action" value="reset" />
! f' g s5 I+ j( V3 Z</p>1 R& e7 D$ O, T8 e) u' t4 I& D, h
</form>6 ]1 B9 x6 @3 A/ y% p/ L
: h; @! s7 N" s
</div><!-- ADMIN OPTIONS END -->
( H9 M4 i) Y) Z
" z4 e6 ^9 ]9 {1 @9 g' ]<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }) v- N1 g ~0 r2 m
" p7 \3 Y9 T( D% b
function mytheme_admin_register() {4 B2 Y- n0 f% n- j$ u9 d+ ^5 d
global $themename, $shortname, $options;
& R0 W4 @8 Z1 @$ X5 L2 Zif ( $_GET['page'] == basename(__FILE__) ) {+ n/ t4 W$ l( F. z9 t: b
if ( 'save' == $_REQUEST['action'] ) {
n K' W/ K- x% p y# Nforeach ($options as $value) {
9 t( l0 M* J* \% tupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }- `. P2 S( p1 @, X0 m* X" q
foreach ($options as $value) {* n2 W4 i1 C* r+ V$ Z" Y& U9 Z p$ M
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
, \$ j: e" i9 _0 ]( N8 I+ |9 aheader("Location: themes.php?page=functions.php&saved=true");
& v3 b$ K& H: c$ \' t5 ]die;6 T- ]6 S' T% I9 P0 H
} else if( 'reset' == $_REQUEST['action'] ) {6 g5 ^. B2 P. R% @( }
foreach ($options as $value) {
+ |8 g2 R+ S" e& ?delete_option( $value['id'] ); }; K$ I' B" y% B, C1 d% ~# h
header("Location: themes.php?page=functions.php&reset=true");' F7 m( N0 D$ |3 N# U) i
die;- M! \% ?; L/ s; \
}) t" c6 A. `2 L S- {% f: d
}. u+ h& w4 D7 @* \2 W/ E
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
- x0 g: N! b1 t) m}* o- W6 B# q& z+ |. y& k5 M5 f
" j3 p( W$ j+ x& g: Z1 p: \0 E
function mytheme_admin_head() { ?>: v6 D5 ^: C5 C& D7 z- D# q; u
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />4 R5 R( D/ D2 \' |0 Q8 X7 T& ]
<?php }- v0 {* S4 W' G$ f
|
|