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