|
|

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