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