|
|

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