|
|

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