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