|
|

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