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