|
|

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