|
|

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