|
|

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