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