|
|

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