|
|

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