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