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