|
|

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