|
|

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